Package org.agrona.collections
Class Object2IntHashMap.ValueCollection
- All Implemented Interfaces:
Iterable<Integer>,Collection<Integer>
- Enclosing class:
- Object2IntHashMap<K>
Collection of values which can optionally cache iterators to avoid allocation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontains(int value) Checks if the value is contained in the map.booleaniterator()booleanremoveIfInt(IntPredicate filter) Removes all the elements of this collection that satisfy the given predicate.intsize()Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
ValueCollection
public ValueCollection()Create a new instance.
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceCollection<Integer>- Specified by:
iteratorin interfaceIterable<Integer>- Specified by:
iteratorin classAbstractCollection<Integer>
-
size
public int size()- Specified by:
sizein interfaceCollection<Integer>- Specified by:
sizein classAbstractCollection<Integer>
-
contains
- Specified by:
containsin interfaceCollection<Integer>- Overrides:
containsin classAbstractCollection<Integer>
-
contains
public boolean contains(int value) Checks if the value is contained in the map.- Parameters:
value- to be checked.- Returns:
trueif value is contained in this map.
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Integer>- Overrides:
clearin classAbstractCollection<Integer>
-
removeIfInt
Removes all the elements of this collection that satisfy the given predicate.- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.
-