Ring
An example class wrapping a sequence and keeping a mutable state of rotation and reflection
- Type parameters:
- A
the type of the elements in the sequence
- Value parameters:
- headIndex
mutable state of rotation, a circular index of the sequence head
- isReflected
mutable state of reflection
- underlying
the wrapped sequence
Value members
Concrete methods
Gets the sequence at the current state of rotation and reflection.
Gets the sequence at the current state of rotation and reflection.
- Returns:
the rotated and reflected sequence.
Gets the head element of the sequence at the current state of rotation and reflection.
Gets the head element of the sequence at the current state of rotation and reflection.
- Returns:
the element at the head of the rotated and reflected sequence.
Adds a reflection, the sequence is considered as flowing in the opposite direction.
Adds a reflection, the sequence is considered as flowing in the opposite direction.
Adds a rotation to the left by some steps.
Adds a rotation to the left by some steps.
- Value parameters:
- step
Int