Package org.agrona.collections
Class Int2ObjectCache.KeySet
- Enclosing class:
- Int2ObjectCache<V>
A key set implementation which supports cached iterator to avoid allocation.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.Set
add, addAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
KeySet
public KeySet()Create a new instance.
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<Integer>- Specified by:
sizein interfaceSet<Integer>- Specified by:
sizein classAbstractCollection<Integer>
-
contains
- Specified by:
containsin interfaceCollection<Integer>- Specified by:
containsin interfaceSet<Integer>- Overrides:
containsin classAbstractCollection<Integer>
-
contains
public boolean contains(int 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<Integer>- Specified by:
removein interfaceSet<Integer>- Overrides:
removein classAbstractCollection<Integer>
-
removeIf
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Integer>- Specified by:
clearin interfaceSet<Integer>- Overrides:
clearin classAbstractCollection<Integer>
-