Package org.agrona.collections
Class Long2LongHashMap.ValueCollection
- All Implemented Interfaces:
Iterable<Long>
,Collection<Long>
- Enclosing class:
Long2LongHashMap
Collection of values which supports optionally cached iterators to avoid allocation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(long value) Checks if the value is contained in the map.boolean
iterator()
boolean
removeIfLong
(LongPredicate 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()Create a new instance.
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceCollection<Long>
- Specified by:
iterator
in interfaceIterable<Long>
- Specified by:
iterator
in classAbstractCollection<Long>
-
size
public int size()- Specified by:
size
in interfaceCollection<Long>
- Specified by:
size
in classAbstractCollection<Long>
-
contains
- Specified by:
contains
in interfaceCollection<Long>
- Overrides:
contains
in classAbstractCollection<Long>
-
contains
public boolean contains(long value) Checks if the value is contained in the map.- Parameters:
value
- to be checked.- Returns:
true
if value is contained in this map.
-
removeIfLong
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.
-