Package components.list
Class List1L<T>
java.lang.Object
components.list.ListSecondary<T>
components.list.List1L<T>
- Type Parameters:
T- type ofListentries
- All Implemented Interfaces:
List<T>,ListKernel<T>,Standard<List<T>>,Iterable<T>
List represented as a java.util.List with
implementations of primary methods.- Abstraction Relation (interpretation mapping between $this and this):
this.left = [$this.leftList, based on java.util.List's "proper sequence"] and this.right = [$this.rightList, based on java.util.List's "proper sequence"]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddRightFront(T x) Addsxto the beginning ofthis.right.final voidadvance()Advances the position inthisby one.final voidclear()Resetsthisto an initial value.iterator()final intReports length ofthis.left.final voidMoves the position inthisto the end.final voidMoves the position inthisto the beginning.Returns a new object with the same dynamic type asthis, having an initial value.final TRemoves and returns the entry at the front ofthis.right.final TReplaces the entry at the front ofthis.rightwithx, and returns the old entry.final voidretreat()Retreats the position inthisby one.final TReports the front ofthis.right.final intReports length ofthis.right.final voidtransferFrom(List<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.list.ListSecondary
equals, hashCode, swapRights, 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
-
List1L
public List1L()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
-
addRightFront
Description copied from interface:ListKernelAddsxto the beginning ofthis.right.- Parameters:
x- the entry to be added
-
removeRightFront
Description copied from interface:ListKernelRemoves and returns the entry at the front ofthis.right.- Returns:
- the front entry of
this.right
-
advance
Description copied from interface:ListKernelAdvances the position inthisby one. -
moveToStart
Description copied from interface:ListKernelMoves the position inthisto the beginning. -
leftLength
Description copied from interface:ListKernelReports length ofthis.left.- Returns:
- the length of
this.left
-
rightLength
Description copied from interface:ListKernelReports length ofthis.right.- Returns:
- the length of
this.right
-
iterator
-
rightFront
Description copied from interface:ListReports the front ofthis.right.- Specified by:
rightFrontin interfaceList<T>- Overrides:
rightFrontin classListSecondary<T>- Returns:
- the front entry of
this.right
-
replaceRightFront
Description copied from interface:ListReplaces the entry at the front ofthis.rightwithx, and returns the old entry.- Specified by:
replaceRightFrontin interfaceList<T>- Overrides:
replaceRightFrontin classListSecondary<T>- Parameters:
x- the new entry- Returns:
- the old front entry of
this.right
-
moveToFinish
Description copied from interface:ListMoves the position inthisto the end.- Specified by:
moveToFinishin interfaceList<T>- Overrides:
moveToFinishin classListSecondary<T>
-
retreat
Description copied from interface:ListRetreats the position inthisby one.
-