ELEMENTTYPE - Element type@NotThreadSafe @UseDirectEqualsAndHashCode public class LRUSet<ELEMENTTYPE> extends AbstractSet<ELEMENTTYPE> implements IHasSize, Serializable
LRUCache map.| Constructor and Description |
|---|
LRUSet(int nMaxSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ELEMENTTYPE aItem) |
boolean |
equals(Object o) |
int |
getMaxSize() |
int |
hashCode() |
Iterator<ELEMENTTYPE> |
iterator() |
protected void |
onRemoveEldestEntry(ELEMENTTYPE aEldest)
Protected method that is invoked every time an element is removed from the
cache, because the maximum size is exceeded.
|
int |
size() |
String |
toString() |
removeAlladdAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArraypublic LRUSet(@Nonnegative int nMaxSize)
@OverrideOnDemand protected void onRemoveEldestEntry(@Nonnull ELEMENTTYPE aEldest)
aEldest - The entry that is to be removed. Never null.@Nonnegative public final int getMaxSize()
public boolean add(@Nullable ELEMENTTYPE aItem)
add in interface Collection<ELEMENTTYPE>add in interface Set<ELEMENTTYPE>add in class AbstractCollection<ELEMENTTYPE>@Nonnull public Iterator<ELEMENTTYPE> iterator()
iterator in interface Iterable<ELEMENTTYPE>iterator in interface Collection<ELEMENTTYPE>iterator in interface Set<ELEMENTTYPE>iterator in class AbstractCollection<ELEMENTTYPE>@Nonnegative public int size()
size in interface IHasSizesize in interface Collection<ELEMENTTYPE>size in interface Set<ELEMENTTYPE>size in class AbstractCollection<ELEMENTTYPE>public boolean equals(Object o)
equals in interface Collection<ELEMENTTYPE>equals in interface Set<ELEMENTTYPE>equals in class AbstractSet<ELEMENTTYPE>public int hashCode()
hashCode in interface Collection<ELEMENTTYPE>hashCode in interface Set<ELEMENTTYPE>hashCode in class AbstractSet<ELEMENTTYPE>public String toString()
toString in class AbstractCollection<ELEMENTTYPE>Copyright © 2006–2015 phloc systems. All rights reserved.