Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlyListFacade<E>
java.lang.Object
org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection<E>
org.jhotdraw8.icollection.readonly.AbstractReadOnlyList<E>
org.jhotdraw8.icollection.facade.ReadOnlyListFacade<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterable<E>,ReadOnlyCollection<E>,ReadOnlyList<E>,ReadOnlySequencedCollection<E>
Provides a
ReadOnlyList facade to a set of ReadOnlyList functions.- Author:
- Werner Randelshofer
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyListFacade(IntSupplier sizeFunction, IntFunction<E> getFunction) ReadOnlyListFacade(IntSupplier sizeFunction, IntFunction<E> getFunction, Supplier<ReadOnlySequencedCollection<E>> readOnlyReversedFunction) ReadOnlyListFacade(List<E> backingList) -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Returns the element at the specified position in this list.Returns a reversed-order view of this collection.readOnlySubList(int fromIndex, int toIndex) Returns a view of the portion of this list between the specified *fromIndex, inclusive, andtoIndex, exclusive.intsize()Returns the size of the collection.Methods inherited from class org.jhotdraw8.icollection.readonly.AbstractReadOnlyList
equals, hashCodeMethods inherited from class org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection
contains, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
characteristics, contains, containsAll, isEmpty, stream, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyList
asList, getFirst, getLast, getLast, indexOf, iterator, lastIndexOf, listIterator, listIterator, peekFirst, peekLast, spliteratorMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySequencedCollection
asCollection
-
Constructor Details
-
ReadOnlyListFacade
-
ReadOnlyListFacade
-
ReadOnlyListFacade
public ReadOnlyListFacade(IntSupplier sizeFunction, IntFunction<E> getFunction, Supplier<ReadOnlySequencedCollection<E>> readOnlyReversedFunction)
-
-
Method Details
-
get
Description copied from interface:ReadOnlyListReturns the element at the specified position in this list.- Parameters:
index- the index of the element- Returns:
- the element
-
readOnlyReversed
Description copied from interface:ReadOnlySequencedCollectionReturns a reversed-order view of this collection. Changes to the underlying collection are visible in the reversed view.- Returns:
- a reversed-order view of this collection
-
readOnlySubList
Description copied from interface:ReadOnlyListReturns a view of the portion of this list between the specified *fromIndex, inclusive, andtoIndex, exclusive.- Parameters:
fromIndex- the from indextoIndex- the to index (exclusive)- Returns:
- the sub list
-
size
public int size()Description copied from interface:ReadOnlyCollectionReturns the size of the collection.- Returns:
- the size
-