Class TTrack.StepArray

java.lang.Object
org.opensourcephysics.cabrillo.tracker.TTrack.StepArray
Enclosing class:
TTrack

protected class TTrack.StepArray extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Step[]
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a default StepArray.
    Constructs an autofill StepArray and fills the array with clones of the specified step.
    StepArray(Step step, int increment)
    Constructs an autofill StepArray and fills the array with clones of the specified step.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(Step step)
    Determines if this step array contains the specified step.
    getStep(int n)
    Gets the step at the specified index.
    boolean
     
    boolean
    Determines if this is empty.
    boolean
    isPreceded(int n)
    Determines if the specified step is preceded by a lower index step.
    void
    setLength(int len)
    Sets the length of the array.
    void
    setStep(int n, Step step)
    Sets the step at the specified index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delta

      protected int delta
    • array

      protected Step[] array
  • Constructor Details

    • StepArray

      public StepArray()
      Constructs a default StepArray.
    • StepArray

      public StepArray(Step step)
      Constructs an autofill StepArray and fills the array with clones of the specified step.
      Parameters:
      step - the step to fill the array with
    • StepArray

      public StepArray(Step step, int increment)
      Constructs an autofill StepArray and fills the array with clones of the specified step.
      Parameters:
      step - the step to fill the array with
      increment - the array sizing increment
  • Method Details

    • getStep

      public Step getStep(int n)
      Gets the step at the specified index. May return null.
      Parameters:
      n - the array index
      Returns:
      the step
    • setStep

      public void setStep(int n, Step step)
      Sets the step at the specified index. Accepts a null step argument for non-autofill arrays.
      Parameters:
      n - the array index
      step - the new step
    • contains

      public boolean contains(Step step)
      Determines if this step array contains the specified step.
      Parameters:
      step - the new step
      Returns:
      true if this contains the step
    • setLength

      public void setLength(int len)
      Sets the length of the array.
      Parameters:
      len - the new length of the array
    • isEmpty

      public boolean isEmpty()
      Determines if this is empty.
      Returns:
      true if empty
    • isPreceded

      public boolean isPreceded(int n)
      Determines if the specified step is preceded by a lower index step.
      Parameters:
      n - the step index
      Returns:
      true if the step is preceded
    • isAutofill

      public boolean isAutofill()