Package components.sequence
Class Sequence2L<T>
java.lang.Object
components.sequence.SequenceSecondary<T>
components.sequence.Sequence2L<T>
- Type Parameters:
T- type ofSequenceentries
- All Implemented Interfaces:
Sequence<T>,SequenceKernel<T>,Standard<Sequence<T>>,Iterable<T>
Sequence represented as a java.util.LinkedList with implementations of primary methods.- Abstraction Relation (interpretation mapping between $this and this):
this = [value of $this.rep]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds the entryxat positionposofthis.final voidclear()Resetsthisto an initial value.final Tentry(int pos) Reports the entry at positionposofthis.iterator()final intlength()Reports the length ofthis.Returns a new object with the same dynamic type asthis, having an initial value.final Tremove(int pos) Removes and returns the entry at positionposofthis.final voidtransferFrom(Sequence<T> source) Setsthisto the incoming value ofsource, and resetssourceto an initial value; the declaration notwithstanding, the dynamic type ofsourcemust be the same as the dynamic type ofthis.Methods inherited from class components.sequence.SequenceSecondary
append, equals, extract, flip, hashCode, insert, replaceEntry, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Sequence2L
public Sequence2L()No-argument constructor.
-
-
Method Details
-
newInstance
Description copied from interface:StandardReturns a new object with the same dynamic type asthis, having an initial value. If the typeThas a no-argument constructor, then the value of the new returned object satisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, then the value of the new returned object satisfies the contract of the constructor call that was used to initializethis.- Returns:
- new object "like"
thiswith an initial value
-
clear
Description copied from interface:StandardResetsthisto an initial value. If the typeThas a no-argument constructor, thenthissatisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, thenthissatisfies the contract of the constructor call that was used to initialize#this. -
transferFrom
Description copied from interface:StandardSetsthisto the incoming value ofsource, and resetssourceto an initial value; the declaration notwithstanding, the dynamic type ofsourcemust be the same as the dynamic type ofthis. If the typeThas a no-argument constructor, thensourcesatisfies the contract of the no-argument constructor forT. IfTdoes not have a no-argument constructor, thensourcesatisfies the contract of the constructor call that was used to initialize#source.- Parameters:
source- object whose value is to be transferred
-
add
Description copied from interface:SequenceKernelAdds the entryxat positionposofthis.- Parameters:
pos- the position at which to add an entryx- the entry to be added
-
remove
Description copied from interface:SequenceKernelRemoves and returns the entry at positionposofthis.- Parameters:
pos- the position at which to remove an entry- Returns:
- the entry removed
-
length
Description copied from interface:SequenceKernelReports the length ofthis.- Returns:
- the length
-
iterator
-
entry
Description copied from interface:SequenceReports the entry at positionposofthis.
-