ELEMENTTYPE - Element type@NotThreadSafe @UseDirectEqualsAndHashCode public class LRUSet<ELEMENTTYPE> extends AbstractSet<ELEMENTTYPE> implements ICommonsOrderedSet<ELEMENTTYPE>
LRUMap map.| Constructor and Description |
|---|
LRUSet(int nMaxSize) |
LRUSet(LRUSet<ELEMENTTYPE> rhs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ELEMENTTYPE aItem) |
boolean |
equals(Object o) |
LRUSet<ELEMENTTYPE> |
getClone() |
int |
getMaxSize() |
int |
hashCode() |
Iterator<ELEMENTTYPE> |
iterator() |
protected void |
onRemoveEldestEntry(int nSize,
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, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateInstance, getAll, getAllInstanceOf, getAllMapped, getAllMapped, getFirst, getFirst, getLast, getLastgetAsUnmodifiable, replaceaddAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, spliterator, toArray, toArrayaddAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMappedparallelStream, removeIf, streamcontainsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCountisEmpty, isNotEmptypublic LRUSet(@Nonnegative int nMaxSize)
public LRUSet(@Nonnegative LRUSet<ELEMENTTYPE> rhs)
@Nonnull public LRUSet<ELEMENTTYPE> getClone()
getClone in interface ICommonsOrderedSet<ELEMENTTYPE>getClone in interface ICloneable<ICommonsSet<ELEMENTTYPE>>@OverrideOnDemand protected void onRemoveEldestEntry(@Nonnegative int nSize, @Nonnull ELEMENTTYPE aEldest)
nSize - Current size of the map. Always ≥ 0.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 © 2014–2022 Philip Helger. All rights reserved.