Package org.agrona.collections
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 java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.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:
size
in interfaceCollection<Long>
- Specified by:
size
in interfaceSet<Long>
- Specified by:
size
in classAbstractCollection<Long>
-
contains
- Specified by:
contains
in interfaceCollection<Long>
- Specified by:
contains
in interfaceSet<Long>
- Overrides:
contains
in 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:
true
if key is contained in the cache.
-
iterator
-
remove
- Specified by:
remove
in interfaceCollection<Long>
- Specified by:
remove
in interfaceSet<Long>
- Overrides:
remove
in classAbstractCollection<Long>
-
removeIf
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Long>
- Specified by:
clear
in interfaceSet<Long>
- Overrides:
clear
in classAbstractCollection<Long>
-