Package components.sequence
Class Sequence2L<T>
java.lang.Object
components.sequence.SequenceSecondary<T>
components.sequence.Sequence2L<T>
- Type Parameters:
T
- type ofSequence
entries
- 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
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds the entryx
at positionpos
ofthis
.final void
clear()
Resetsthis
to an initial value.final T
entry
(int pos) Reports the entry at positionpos
ofthis
.iterator()
final int
length()
Reports the length ofthis
.Returns a new object with the same dynamic type asthis
, having an initial value.final T
remove
(int pos) Removes and returns the entry at positionpos
ofthis
.final void
transferFrom
(Sequence<T> source) Setsthis
to the incoming value ofsource
, and resetssource
to an initial value; the declaration notwithstanding, the dynamic type ofsource
must be the same as the dynamic type ofthis
.Methods inherited from class components.sequence.SequenceSecondary
append, equals, extract, flip, hashCode, insert, replaceEntry, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Sequence2L
public Sequence2L()No-argument constructor.
-
-
Method Details
-
newInstance
Description copied from interface:Standard
Returns a new object with the same dynamic type asthis
, having an initial value. If the typeT
has a no-argument constructor, then the value of the new returned object satisfies the contract of the no-argument constructor forT
. IfT
does 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"
this
with an initial value
-
clear
Description copied from interface:Standard
Resetsthis
to an initial value. If the typeT
has a no-argument constructor, thenthis
satisfies the contract of the no-argument constructor forT
. IfT
does not have a no-argument constructor, thenthis
satisfies the contract of the constructor call that was used to initialize#this
. -
transferFrom
Description copied from interface:Standard
Setsthis
to the incoming value ofsource
, and resetssource
to an initial value; the declaration notwithstanding, the dynamic type ofsource
must be the same as the dynamic type ofthis
. If the typeT
has a no-argument constructor, thensource
satisfies the contract of the no-argument constructor forT
. IfT
does not have a no-argument constructor, thensource
satisfies 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:SequenceKernel
Adds the entryx
at positionpos
ofthis
.- Parameters:
pos
- the position at which to add an entryx
- the entry to be added
-
remove
Description copied from interface:SequenceKernel
Removes and returns the entry at positionpos
ofthis
.- Parameters:
pos
- the position at which to remove an entry- Returns:
- the entry removed
-
length
Description copied from interface:SequenceKernel
Reports the length ofthis
.- Returns:
- the length
-
iterator
-
entry
Description copied from interface:Sequence
Reports the entry at positionpos
ofthis
.
-