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 classA stateful reusable iterator. -
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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
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>
-