K - V - public class LRUSet<E> extends AbstractSet<E> implements Set<E>, Cloneable, Serializable
| Constructor and Description |
|---|
LRUSet()
Default constructor for an LRU Cache The default capacity is 10000
|
LRUSet(int maximumCacheSize)
Constructs a LRUCache with a maximum capacity
|
LRUSet(int initialCapacity,
int maximumCacheSize,
float loadFactor,
boolean accessOrder)
Constructs an empty LRUCache instance with the specified
initial capacity, maximumCacheSize,load factor and ordering mode.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
int |
size() |
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringpublic LRUSet()
public LRUSet(int maximumCacheSize)
maximumCacheSize - public LRUSet(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder)
initialCapacity - the initial capacity.maximumCacheSize - loadFactor - the load factor.accessOrder - the ordering mode - true for access-order,
false for insertion-order.IllegalArgumentException - if the initial capacity is negative or the load factor is
non-positive.public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>Copyright © 2005–2017. All rights reserved.