abstract class SimpleARC<K,V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V>, java.lang.Iterable<java.util.Map.Entry<K,V>>, ARC<K,V>
Modifier and Type | Field and Description |
---|---|
protected int |
cacheSize |
protected java.util.Map<K,V> |
levelA |
protected java.util.Map<K,V> |
levelB |
Constructor and Description |
---|
SimpleARC() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
clear the cache
|
boolean |
containsKey(java.lang.Object s)
check if the map contains the key
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Return a Set view of the mappings contained in this map.
|
V |
get(java.lang.Object s)
get a value from the cache.
|
java.util.Collection<K> |
getKeys(V value)
check if the map contains the value
|
int |
hashCode()
a hash code for this ARC
|
void |
insert(K s,
V v)
put a value to the cache.
|
void |
insertIfAbsent(K s,
V v)
put a value to the cache if there was not an entry before
do not return a previous content value
|
java.util.Iterator<java.util.Map.Entry<K,V>> |
iterator()
iterator implements the Iterable interface
|
V |
put(K s,
V v)
put a value to the cache.
|
V |
putIfAbsent(K s,
V v)
put a value to the cache if there was not an entry before
return a previous content value
|
V |
remove(java.lang.Object s)
remove an entry from the cache
|
int |
size()
get the size of the ARC.
|
clone, containsValue, equals, isEmpty, keySet, putAll, toString, values
public void insertIfAbsent(K s, V v)
insertIfAbsent
in interface ARC<K,V>
s
- v
- public V putIfAbsent(K s, V v)
putIfAbsent
in interface ARC<K,V>
s
- v
- public final V get(java.lang.Object s)
public final boolean containsKey(java.lang.Object s)
public final V remove(java.lang.Object s)
public final void clear()
public final int size()
public final java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
public final java.util.Set<java.util.Map.Entry<K,V>> entrySet()