Class Long2ObjectCache.KeySet
- Enclosing class:
Long2ObjectCache<V>
A key set implementation which supports cached iterator to avoid allocation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface Set
add, addAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
Field Details
-
iterator
-
-
Constructor Details
-
KeySet
public KeySet()Create a new instance.
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<Long>- Specified by:
sizein interfaceSet<Long>- Specified by:
sizein classAbstractCollection<Long>
-
contains
- Specified by:
containsin interfaceCollection<Long>- Specified by:
containsin interfaceSet<Long>- Overrides:
containsin classAbstractCollection<Long>
-
contains
public boolean contains(long key) Check if the given key contained in the set without boxing.- Parameters:
key- to be checked.- Returns:
trueif key is contained in the cache.
-
iterator
-
remove
- Specified by:
removein interfaceCollection<Long>- Specified by:
removein interfaceSet<Long>- Overrides:
removein classAbstractCollection<Long>
-
removeIf
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Long>- Specified by:
clearin interfaceSet<Long>- Overrides:
clearin classAbstractCollection<Long>
-