Package components.sequence
Interface SequenceKernel<T>
- Type Parameters:
T- type ofSequenceKernelentries
- All Known Subinterfaces:
Sequence<T>
- All Known Implementing Classes:
Sequence1L,Sequence2L,Sequence3,SequenceSecondary
Sequence kernel component with primary methods. (Note: by package-wide
convention, all references are non-null.)
- Mathematical Model (abstract value and abstract invariant of this):
type SequenceKernel is modeled by string of T- Constructor(s) (initial abstract value(s) of this):
(): ensures this = <>- Iterator String (abstract value of ~this):
~this.seen * ~this.unseen = this
-
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Method Details
-
add
Adds the entryxat positionposofthis.- Parameters:
pos- the position at which to add an entryx- the entry to be added- Aliases:
- reference
x - Updates:
this- Requires:
0 <= pos and pos <= |this|- Ensures:
this = #this[0, pos) * <x> * #this[pos, |#this|)
-
remove
Removes and returns the entry at positionposofthis.- Parameters:
pos- the position at which to remove an entry- Returns:
- the entry removed
- Updates:
this- Requires:
0 <= pos and pos < |this|- Ensures:
this = #this[0, pos) * #this[pos+1, |#this|) and <remove> = #this[pos, pos+1)
-
length
int length()Reports the length ofthis.- Returns:
- the length
- Ensures:
length = |this|
-