Package org.agrona.collections
Class UnmodifiableCollectionView<V,E>
- java.lang.Object
-
- java.util.AbstractCollection<V>
-
- org.agrona.collections.UnmodifiableCollectionView<V,E>
-
- Type Parameters:
V
- The type of the view.E
- The type of the underlying element.
- All Implemented Interfaces:
java.lang.Iterable<V>
,java.util.Collection<V>
public class UnmodifiableCollectionView<V,E> extends java.util.AbstractCollection<V>
An unmodifiable view of a collection that maps each element in an underlying collection into a view.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
UnmodifiableCollectionView.ReusableIterator
A stateful reusable iterator.
-
Constructor Summary
Constructors Constructor Description UnmodifiableCollectionView(java.util.function.Function<E,V> viewer, java.util.Collection<E> elements)
Constructs an unmodifiable view over collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnmodifiableCollectionView.ReusableIterator
iterator()
int
size()
-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, 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
-
iterator
private final UnmodifiableCollectionView.ReusableIterator iterator
-
elements
private final java.util.Collection<E> elements
-
-
Method Detail
-
size
public int size()
-
iterator
public UnmodifiableCollectionView.ReusableIterator iterator()
-
-