Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class MutableListFacade<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.jhotdraw8.icollection.facade.MutableListFacade<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,SequencedCollection<E>,ReadOnlyCollection<E>,ReadOnlyList<E>,ReadOnlySequencedCollection<E>
Provides a
List facade to a set of ImmutableList functions.- Author:
- Werner Randelshofer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidvoidvoidclear()booleanReturnstrueif this collection contains the specified object.get(int index) Returns the element at the specified position in this list.getFirst()Gets the first element of the list.getLast()Gets the last element of the list.iterator()Returns an iterator over elements of typeE.listIterator(int index) Returns a list iterator over elements of typeEstarting at the specified index.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.remove(int index) booleanreversed()intsize()Returns the size of the collection.Returns a spliterator over elements of typeE.stream()Returns a stream.Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, toArrayMethods inherited from interface java.util.List
addAll, addAll, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, removeAll, removeFirst, removeLast, replaceAll, retainAll, sort, subList, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
characteristics, containsAll, isEmpty, toArray, toArrayMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyList
asList, equals, getLast, hashCode, indexOf, lastIndexOf, listIterator, peekFirst, peekLastMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySequencedCollection
asCollection
-
Constructor Details
-
MutableListFacade
-
-
Method Details
-
addFirst
-
addLast
-
reversed
-
readOnlyReversed
Description copied from interface:ReadOnlySequencedCollectionReturns a reversed-order view of this collection. Changes to the underlying collection are visible in the reversed view.- Specified by:
readOnlyReversedin interfaceReadOnlySequencedCollection<E>- Returns:
- a reversed-order view of this collection
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractCollection<E>
-
remove
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
spliterator
Description copied from interface:ReadOnlyListReturns a spliterator over elements of typeE.- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceList<E>- Specified by:
spliteratorin interfaceReadOnlyList<E>- Returns:
- an iterator.
-
readOnlySubList
Description copied from interface:ReadOnlyListReturns a view of the portion of this list between the specified *fromIndex, inclusive, andtoIndex, exclusive.- Specified by:
readOnlySubListin interfaceReadOnlyList<E>- Parameters:
fromIndex- the from indextoIndex- the to index (exclusive)- Returns:
- the sub list
-
stream
Description copied from interface:ReadOnlyCollectionReturns a stream.- Specified by:
streamin interfaceCollection<E>- Specified by:
streamin interfaceReadOnlyCollection<E>- Returns:
- a stream
-
iterator
Description copied from interface:ReadOnlyListReturns an iterator over elements of typeE.- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceList<E>- Specified by:
iteratorin interfaceReadOnlyCollection<E>- Specified by:
iteratorin interfaceReadOnlyList<E>- Overrides:
iteratorin classAbstractList<E>- Returns:
- an iterator.
-
reverseIterator
-
size
public int size()Description copied from interface:ReadOnlyCollectionReturns the size of the collection.- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein interfaceReadOnlyCollection<E>- Specified by:
sizein classAbstractCollection<E>- Returns:
- the size
-
contains
Description copied from interface:ReadOnlyCollectionReturnstrueif this collection contains the specified object.- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Specified by:
containsin interfaceReadOnlyCollection<E>- Overrides:
containsin classAbstractCollection<E>- Parameters:
o- an object- Returns:
trueif this collection contains the specified object
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classAbstractList<E>
-
add
-
set
-
get
Description copied from interface:ReadOnlyListReturns the element at the specified position in this list.- Specified by:
getin interfaceList<E>- Specified by:
getin interfaceReadOnlyList<E>- Specified by:
getin classAbstractList<E>- Parameters:
index- the index of the element- Returns:
- the element
-
getFirst
Description copied from interface:ReadOnlyListGets the first element of the list.- Specified by:
getFirstin interfaceList<E>- Specified by:
getFirstin interfaceReadOnlyList<E>- Specified by:
getFirstin interfaceReadOnlySequencedCollection<E>- Specified by:
getFirstin interfaceSequencedCollection<E>- Returns:
- the first element
-
getLast
Description copied from interface:ReadOnlyListGets the last element of the list.- Specified by:
getLastin interfaceList<E>- Specified by:
getLastin interfaceReadOnlyList<E>- Specified by:
getLastin interfaceReadOnlySequencedCollection<E>- Specified by:
getLastin interfaceSequencedCollection<E>- Returns:
- the last element
-
listIterator
Description copied from interface:ReadOnlyListReturns a list iterator over elements of typeEstarting at the specified index.- Specified by:
listIteratorin interfaceList<E>- Specified by:
listIteratorin interfaceReadOnlyList<E>- Overrides:
listIteratorin classAbstractList<E>- Parameters:
index- the start index- Returns:
- a list iterator.
-