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:
Iterable<V>
,Collection<V>
An unmodifiable view of a collection that maps each element in an underlying collection into a view.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
A stateful reusable iterator. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection
<E> private final UnmodifiableCollectionView<V,
E>.ReusableIterator -
Constructor Summary
ConstructorsConstructorDescriptionUnmodifiableCollectionView
(Function<E, V> viewer, Collection<E> elements) Constructs an unmodifiable view over collection. -
Method Summary
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
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
iterator
-
viewer
-
elements
-
-
Constructor Details
-
UnmodifiableCollectionView
Constructs an unmodifiable view over collection.- Parameters:
viewer
- function.elements
- collection to create a view for.
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceCollection<V>
- Specified by:
size
in classAbstractCollection<V>
-
iterator
- Specified by:
iterator
in interfaceCollection<V>
- Specified by:
iterator
in interfaceIterable<V>
- Specified by:
iterator
in classAbstractCollection<V>
-