Package components.list
Interface List<T>
- Type Parameters:
T- type ofListentries
- All Superinterfaces:
Iterable<T>,ListKernel<T>,Standard<List<T>>
- All Known Implementing Classes:
List1L,List2,List3,ListSecondary
ListKernel enhanced with secondary methods.-
Method Summary
Modifier and TypeMethodDescriptionvoidMoves the position inthisto the end.Replaces the entry at the front ofthis.rightwithx, and returns the old entry.voidretreat()Retreats the position inthisby one.Reports the front ofthis.right.voidswapRights(List<T> list) Swaps the right strings ofthisandlist.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface components.list.ListKernel
addRightFront, advance, leftLength, moveToStart, removeRightFront, rightLengthMethods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Method Details
-
rightFront
T rightFront()Reports the front ofthis.right.- Returns:
- the front entry of
this.right - Aliases:
- reference returned by
rightFront - Requires:
this.right /= <>- Ensures:
<rightFront> is prefix of this.right
-
replaceRightFront
Replaces the entry at the front ofthis.rightwithx, and returns the old entry.- Parameters:
x- the new entry- Returns:
- the old front entry of
this.right - Aliases:
- reference
x - Updates:
this.right- Requires:
this.right /= <>- Ensures:
<replaceRightFront> is prefix of #this.right and this.right = <x> * #this.right[1, |#this.right|)
-
moveToFinish
void moveToFinish()Moves the position inthisto the end.- Updates:
this- Ensures:
this.left = #this.left * #this.right and |this.right| = 0
-
retreat
void retreat()Retreats the position inthisby one.- Updates:
this- Requires:
this.left /= <>- Ensures:
this.left * this.right = #this.left * #this.right and |this.left| = |#this.left| - 1
-
swapRights
Swaps the right strings ofthisandlist.- Parameters:
list- theListwhose right string is to be swapped with the right string ofthis- Updates:
this.right, list.right- Ensures:
this.left = #this.left and list.left = #list.left and this.right = #list.right and list.right = #this.right
-