Package org.midheaven.collections
Interface EditableSequence<T>
- Type Parameters:
T- type of element in the EditableSequence
- All Superinterfaces:
Assortment<T>,Countable,Enumerable<T>,Iterable<T>,Sequence<T>
- All Known Subinterfaces:
Array<T>,ResizableSequence<T>
-
Method Summary
Modifier and TypeMethodDescriptionreversed()Creates a Sequence view that is the reverse of this one.Replaces the element at the given index, with the given elementReplaces the element at the given index, with the given elementReplaces the element at index 0, with the given elementReplaces the element at the last index, with the given elementsubSequence(int fromIndex, int toIndex) Creates a view of this Sequence between the given indexesdefault EditableSequence<T> Returns aSequencewith the elements in thisEnumerable.Returns an unmodifiable view of thisEditableSequenceMethods inherited from interface org.midheaven.collections.Assortment
containsAll, count, isEmptyMethods inherited from interface org.midheaven.collections.Enumerable
allMatch, any, anyMatch, as, associate, associate, collect, concat, distinct, enumerator, flatMap, groupBy, limit, maximum, minimum, peek, reduce, reduce, skip, toArray, toArray, toArray, toDistinctAssortment, toSequence, with, zipMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.midheaven.collections.Sequence
cast, contains, filter, first, getAt, getAt, indexOf, iterator, last, lastIndexOf, map, ofType, reverseIterator, sorted, subSequence, toCollection
-
Method Details
-
toUnmodifiable
Returns an unmodifiable view of thisEditableSequence- Returns:
- an unmodifiable view of this
EditableSequence
-
setAt
Replaces the element at the given index, with the given element- Parameters:
index- the index to replaceelement- the new element- Returns:
- the value previous present at the index
-
setAt
Replaces the element at the given index, with the given element- Parameters:
index- the index to replaceelement- the new element- Returns:
- the value previous present at the index
-
setFirst
Replaces the element at index 0, with the given element- Parameters:
element- the new element- Returns:
- the value previous present at the index
-
setLast
Replaces the element at the last index, with the given element- Parameters:
element- the new element- Returns:
- the value previous present at the index
-
subSequence
Creates a view of this Sequence between the given indexes- Specified by:
subSequencein interfaceSequence<T>- Parameters:
fromIndex- the start indextoIndex- the end index- Returns:
- the resulting sub subSequence
-
reversed
EditableSequence<T> reversed()Creates a Sequence view that is the reverse of this one. -
toSequence
Returns aSequencewith the elements in thisEnumerable. TheEnumerablemust be finite or an exception will be thrown- Specified by:
toSequencein interfaceEnumerable<T>- Specified by:
toSequencein interfaceSequence<T>- Returns:
- the result of toSequence
-