Package org.agrona.collections
Class Int2IntHashMap.EntrySet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
- org.agrona.collections.Int2IntHashMap.EntrySet
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
,java.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
,java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Enclosing class:
- Int2IntHashMap
public final class Int2IntHashMap.EntrySet extends java.util.AbstractSet<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
Set of entries which supports optionally cached iterators to avoid allocation.
-
-
Field Summary
Fields Modifier and Type Field Description private Int2IntHashMap.EntryIterator
entryIterator
-
Constructor Summary
Constructors Constructor Description EntrySet()
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(java.lang.Object o)
boolean
isEmpty()
Int2IntHashMap.EntryIterator
iterator()
boolean
removeIfInt(IntIntPredicate filter)
Removes all the elements of this collection that satisfy the given predicate.int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, remove, retainAll, toString
-
-
-
-
Field Detail
-
entryIterator
private final Int2IntHashMap.EntryIterator entryIterator
-
-
Method Detail
-
iterator
public Int2IntHashMap.EntryIterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
iterator
in interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
iterator
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
iterator
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
size
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
size
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
isEmpty
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Overrides:
isEmpty
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
clear
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Overrides:
clear
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
contains
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Overrides:
contains
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
removeIfInt
public boolean removeIfInt(IntIntPredicate 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 entry was removed.
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
toArray
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Overrides:
toArray
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Specified by:
toArray
in interfacejava.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
- Overrides:
toArray
in classjava.util.AbstractCollection<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>>
-
-