Package org.agrona.collections
Class Int2IntHashMap.ValueCollection
- All Implemented Interfaces:
Iterable<Integer>
,Collection<Integer>
- Enclosing class:
Int2IntHashMap
Collection of values which supports optionally cached iterators to avoid allocation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int value) Checks if the value is contained in the map.boolean
iterator()
boolean
removeIfInt
(IntPredicate filter) Removes all the elements of this collection that satisfy the given predicate.int
size()
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
valueIterator
-
-
Constructor Details
-
ValueCollection
public ValueCollection()
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceCollection<Integer>
- Specified by:
iterator
in interfaceIterable<Integer>
- Specified by:
iterator
in classAbstractCollection<Integer>
-
size
public int size()- Specified by:
size
in interfaceCollection<Integer>
- Specified by:
size
in classAbstractCollection<Integer>
-
contains
- Specified by:
contains
in interfaceCollection<Integer>
- Overrides:
contains
in classAbstractCollection<Integer>
-
contains
public boolean contains(int value) Checks if the value is contained in the map.- Parameters:
value
- to be checked.- Returns:
true
if value is contained in this map.
-
removeIfInt
Removes all the elements of this collection that satisfy the given predicate.NB: Renamed from removeIf to avoid overloading on parameter types of lambda expression, which doesn't play well with type inference in lambda expressions.
- Parameters:
filter
- a predicate to apply.- Returns:
true
if at least one value was removed.
-