Package org.agrona.collections
Class Object2IntHashMap.ValueCollection
- java.lang.Object
-
- java.util.AbstractCollection<java.lang.Integer>
-
- org.agrona.collections.Object2IntHashMap.ValueCollection
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>
,java.util.Collection<java.lang.Integer>
- Enclosing class:
- Object2IntHashMap<K>
public final class Object2IntHashMap.ValueCollection extends java.util.AbstractCollection<java.lang.Integer>
Collection of values which can optionally cache iterators to avoid allocation.
-
-
Field Summary
Fields Modifier and Type Field Description private Object2IntHashMap.ValueIterator
valueIterator
-
Constructor Summary
Constructors Constructor Description ValueCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(int value)
Checks if the value is contained in the map.boolean
contains(java.lang.Object o)
Object2IntHashMap.ValueIterator
iterator()
boolean
removeIfInt(java.util.function.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, 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 Object2IntHashMap.ValueIterator valueIterator
-
-
Method Detail
-
iterator
public Object2IntHashMap.ValueIterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Integer>
- Specified by:
iterator
in classjava.util.AbstractCollection<java.lang.Integer>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
size
in classjava.util.AbstractCollection<java.lang.Integer>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.lang.Integer>
- Overrides:
contains
in classjava.util.AbstractCollection<java.lang.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.
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<java.lang.Integer>
- Overrides:
clear
in classjava.util.AbstractCollection<java.lang.Integer>
-
removeIfInt
public boolean removeIfInt(java.util.function.IntPredicate filter)
Removes all the elements of this collection that satisfy the given predicate.- Parameters:
filter
- a predicate which returnstrue
for elements to be removed.- Returns:
true
if any elements were removed.
-
-