Interface Sequence<T>
- Type Parameters:
T- type ofSequenceentries
- All Superinterfaces:
Iterable<T>, SequenceKernel<T>, Standard<Sequence<T>>
- All Known Implementing Classes:
Sequence1L, Sequence2L, Sequence3, SequenceSecondary
SequenceKernel enhanced with secondary methods.-
Method Summary
Modifier and TypeMethodDescriptionvoidConcatenates ("appends")sto the end ofthis.entry(int pos) Reports the entry at positionposofthis.voidRemoves the substring ofthisstarting at positionpos1and ending at positionpos2-1and puts in its.voidflip()Reverses ("flips")this.voidInsertssintothisat positionpos, i.e., after thepos-th entry ofthis; and clearss.replaceEntry(int pos, T x) Replaces the entry at positionposofthiswith the entryxand returns the old entry at that position.Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface SequenceKernel
add, length, removeMethods inherited from interface Standard
clear, newInstance, transferFrom
-
Method Details
-
entry
-
replaceEntry
Replaces the entry at positionposofthiswith the entryxand returns the old entry at that position.- Parameters:
pos- the position at which to replace an entryx- the entry replacing the old one- Returns:
- the old entry at that position
- Aliases:
- reference
x - Updates:
this- Requires:
0 <= pos and pos < |this|- Ensures:
<replaceEntry> = #this[pos, pos+1) and this = #this[0, pos) * <x> * #this[pos+1, |#this|)
-
append
-
flip
-
insert
Insertssintothisat positionpos, i.e., after thepos-th entry ofthis; and clearss.- Parameters:
pos- the position at which to inserts- theSequenceto be inserted- Updates:
this- Clears:
s- Requires:
0 <= pos and pos <= |this|- Ensures:
this = #this[0, pos) * #s * #this[pos, |#this|)
-
extract
Removes the substring ofthisstarting at positionpos1and ending at positionpos2-1and puts in its.- Parameters:
pos1- the position of the first entry that is extractedpos2- the position of the first entry, after the extracted substring, that is not extracteds- upon return, the extracted substring- Updates:
this- Replaces:
s- Requires:
0 <= pos1 and pos1 <= pos2 and pos2 <= |this|- Ensures:
this = #this[0, pos1) * #this[pos2, |#this|) and s = #this[pos1, pos2)
-