Package org.agrona.collections
Class Long2LongHashMap.ValueCollection
- java.lang.Object
-
- java.util.AbstractCollection<java.lang.Long>
-
- org.agrona.collections.Long2LongHashMap.ValueCollection
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Long>
,java.util.Collection<java.lang.Long>
- Enclosing class:
- Long2LongHashMap
public final class Long2LongHashMap.ValueCollection extends java.util.AbstractCollection<java.lang.Long>
Collection of values which supports optionally cached iterators to avoid allocation.
-
-
Field Summary
Fields Modifier and Type Field Description private Long2LongHashMap.ValueIterator
valueIterator
-
Constructor Summary
Constructors Constructor Description ValueCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(long value)
Checks if the value is contained in the map.boolean
contains(java.lang.Object o)
Long2LongHashMap.ValueIterator
iterator()
boolean
removeIfLong(java.util.function.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
-
-
-
-
Field Detail
-
valueIterator
private final Long2LongHashMap.ValueIterator valueIterator
-
-
Method Detail
-
iterator
public Long2LongHashMap.ValueIterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Long>
- Specified by:
iterator
in classjava.util.AbstractCollection<java.lang.Long>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Long>
- Specified by:
size
in classjava.util.AbstractCollection<java.lang.Long>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.lang.Long>
- Overrides:
contains
in classjava.util.AbstractCollection<java.lang.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
public boolean removeIfLong(java.util.function.LongPredicate filter)
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.
-
-