Class SequenceSecondary<T>

java.lang.Object
components.sequence.SequenceSecondary<T>
Type Parameters:
T - type of Sequence entries
All Implemented Interfaces:
Sequence<T>, SequenceKernel<T>, Standard<Sequence<T>>, Iterable<T>
Direct Known Subclasses:
Sequence1L, Sequence2L, Sequence3

public abstract class SequenceSecondary<T> extends Object implements Sequence<T>
Layered implementations of secondary methods for Sequence.
  • Constructor Details

  • Method Details

    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • entry

      public T entry(int pos)
      Description copied from interface: Sequence
      Reports the entry at position pos of this.
      Specified by:
      entry in interface Sequence<T>
      Parameters:
      pos - the position of the entry
      Returns:
      the entry at that position
    • replaceEntry

      public T replaceEntry(int pos, T x)
      Description copied from interface: Sequence
      Replaces the entry at position pos of this with the entry x and returns the old entry at that position.
      Specified by:
      replaceEntry in interface Sequence<T>
      Parameters:
      pos - the position at which to replace an entry
      x - the entry replacing the old one
      Returns:
      the old entry at that position
    • append

      public void append(Sequence<T> s)
      Description copied from interface: Sequence
      Concatenates ("appends") s to the end of this.
      Specified by:
      append in interface Sequence<T>
      Parameters:
      s - the Sequence to be appended
    • flip

      public void flip()
      Description copied from interface: Sequence
      Reverses ("flips") this.
      Specified by:
      flip in interface Sequence<T>
    • insert

      public void insert(int pos, Sequence<T> s)
      Description copied from interface: Sequence
      Inserts s into this at position pos, i.e., after the pos-th entry of this; and clears s.
      Specified by:
      insert in interface Sequence<T>
      Parameters:
      pos - the position at which to insert
      s - the Sequence to be inserted
    • extract

      public void extract(int pos1, int pos2, Sequence<T> s)
      Description copied from interface: Sequence
      Removes the substring of this starting at position pos1 and ending at position pos2-1 and puts in it s.
      Specified by:
      extract in interface Sequence<T>
      Parameters:
      pos1 - the position of the first entry that is extracted
      pos2 - the position of the first entry, after the extracted substring, that is not extracted
      s - upon return, the extracted substring