public class LRUHashtable<K,V> extends Object implements Cloneable, CacheImplementationInterface<K,V>, SizeMeasurable
Cache| Modifier and Type | Class and Description |
|---|---|
class |
LRUHashtable.LRUEntry
Deprecated.
Element used to store information from the LRUHashtable.
|
protected class |
LRUHashtable.LRUEntrySet
Deprecated.
Used by 'entrySet' implementation, to make the Map modifiable.
|
protected class |
LRUHashtable.LRUEntrySetIterator
Deprecated.
Used by 'entrySet' implementation, to make the Map modifiable.
|
protected class |
LRUHashtable.LRUValues
Deprecated.
|
| Constructor and Description |
|---|
LRUHashtable()
Deprecated.
Creates the URL Hashtable with maximum capacity 100,
starting capacity 101, and growing capacity 0.75.
|
LRUHashtable(int size)
Deprecated.
Creates the URL Hashtable with starting capacity 101 and
growing capacity 0.75.
|
LRUHashtable(int size,
int cap)
Deprecated.
Creates the URL Hashtable with growing capacity 0.75.
|
LRUHashtable(int size,
int cap,
float lf)
Deprecated.
Creates the URL Hashtable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
Clears the table.
|
Object |
clone()
Deprecated.
NOT IMPLEMENTED
|
void |
config(Map<String,String> map)
Deprecated.
Configure the implementation with the given configuration values
|
boolean |
containsKey(Object o)
Deprecated.
|
boolean |
containsValue(Object o)
Deprecated.
|
Enumeration<V> |
elements()
Deprecated.
Returns an
Enumeration on the table's element values. |
Set<Map.Entry<K,V>> |
entrySet()
Deprecated.
Returns the entries of this Map.
|
V |
get(Object key)
Deprecated.
Retrieves an element from the table.
|
int |
getByteSize()
Deprecated.
Determines the byte-size of this object
|
int |
getByteSize(SizeOf sizeof)
Deprecated.
Determines the byte-size of this object using the given SizeOf instance.
|
int |
getCount(Object key)
Deprecated.
Retrieves the count of the object with a certain key.
|
Object |
getLock()
Deprecated.
The cache implementation must be somehow thread-safe.
|
Enumeration<V> |
getOrderedElements()
Deprecated.
use getOrderedEntries
|
Enumeration<V> |
getOrderedElements(int maxnumber)
Deprecated.
use getOrderedEntries
|
List<? extends Map.Entry<K,V>> |
getOrderedEntries()
Deprecated.
Returns an ordered list of Map.Entry's.
|
List<? extends Map.Entry<K,V>> |
getOrderedEntries(int maxNumber)
Deprecated.
Returns an ordered list of Map.Entry's.
|
boolean |
isEmpty()
Deprecated.
|
Set<K> |
keySet()
Deprecated.
You should only remove entries from LRUHashtable using the 'remove' function, or using the
iterator of entrySet() otherwise the linked list gets messed up.
|
int |
maxSize()
Deprecated.
Return the maximum size of the table
|
V |
put(K key,
V value)
Deprecated.
Store an element in the table.
|
void |
putAll(Map<? extends K,? extends V> t)
Deprecated.
|
V |
remove(Object key)
Deprecated.
Remove an element from the table.
|
void |
setMaxSize(int size)
Deprecated.
Change the maximum size of the table.
|
int |
size()
Deprecated.
Return the current size of the table
|
String |
toString()
Deprecated.
Returns a description of the table.
|
String |
toString(boolean which)
Deprecated.
Returns a description of the table.
|
Collection<V> |
values()
Deprecated.
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic LRUHashtable(int size,
int cap,
float lf)
size - the maximum capacitycap - the starting capacity (used to improve performance)lf - the amount with which current capacity frowspublic LRUHashtable(int size,
int cap)
size - the maximum capacitycap - the starting capacity (used to improve performance)public LRUHashtable(int size)
size - the maximum capacitypublic LRUHashtable()
public Object getLock()
CacheImplementationInterfacegetLock in interface CacheImplementationInterface<K,V>public boolean containsValue(Object o)
containsValue in interface Map<K,V>public boolean containsKey(Object o)
containsKey in interface Map<K,V>public int getCount(Object key)
getCount in interface CacheImplementationInterface<K,V>key - the key of the elementpublic Set<K> keySet()
public Set<Map.Entry<K,V>> entrySet()
public Collection<V> values()
public int size()
public void setMaxSize(int size)
setMaxSize in interface CacheImplementationInterface<K,V>size - the new desired sizepublic int maxSize()
maxSize in interface CacheImplementationInterface<K,V>public String toString()
public String toString(boolean which)
which - if true, the stored values are described.public Enumeration<V> elements()
Enumeration on the table's element values.public Enumeration<V> getOrderedElements()
public Enumeration<V> getOrderedElements(int maxnumber)
public List<? extends Map.Entry<K,V>> getOrderedEntries()
public List<? extends Map.Entry<K,V>> getOrderedEntries(int maxNumber)
public void config(Map<String,String> map)
CacheImplementationInterfaceconfig in interface CacheImplementationInterface<K,V>public int getByteSize()
SizeMeasurablegetByteSize in interface SizeMeasurablepublic int getByteSize(SizeOf sizeof)
SizeMeasurablegetByteSize in interface SizeMeasurableMMBase 1.9-SNAPSHOT - ${javadoctimestamp}