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 classA 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 AbstractCollection
add, addAll, clear, contains, 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
-
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:
sizein interfaceCollection<V>- Specified by:
sizein classAbstractCollection<V>
-
iterator
- Specified by:
iteratorin interfaceCollection<V>- Specified by:
iteratorin interfaceIterable<V>- Specified by:
iteratorin classAbstractCollection<V>
-