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 TypeMethodDescriptionbooleancontains(long value) Checks if the value is contained in the map.booleaniterator()booleanremoveIfLong(LongPredicate filter) Removes all the elements of this collection that satisfy the given predicate.intsize()Methods inherited from class AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
iteratorin interfaceCollection<Long>- Specified by:
iteratorin interfaceIterable<Long>- Specified by:
iteratorin classAbstractCollection<Long>
-
size
public int size()- Specified by:
sizein interfaceCollection<Long>- Specified by:
sizein classAbstractCollection<Long>
-
contains
- Specified by:
containsin interfaceCollection<Long>- Overrides:
containsin classAbstractCollection<Long>
-
contains
public boolean contains(long value) Checks if the value is contained in the map.- Parameters:
value- to be checked.- Returns:
trueif 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:
trueif at least one value was removed.
-