Class TTrack.StepArray
java.lang.Object
org.opensourcephysics.cabrillo.tracker.TTrack.StepArray
- Enclosing class:
- TTrack
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a default StepArray.Constructs an autofill StepArray and fills the array with clones of the specified step.Constructs an autofill StepArray and fills the array with clones of the specified step. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if this step array contains the specified step.getStep
(int n) Gets the step at the specified index.boolean
boolean
isEmpty()
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
Sets the step at the specified index.
-
Field Details
-
delta
protected int delta -
array
-
-
Constructor Details
-
StepArray
public StepArray()Constructs a default StepArray. -
StepArray
Constructs an autofill StepArray and fills the array with clones of the specified step.- Parameters:
step
- the step to fill the array with
-
StepArray
Constructs an autofill StepArray and fills the array with clones of the specified step.- Parameters:
step
- the step to fill the array withincrement
- the array sizing increment
-
-
Method Details
-
getStep
Gets the step at the specified index. May return null.- Parameters:
n
- the array index- Returns:
- the step
-
setStep
Sets the step at the specified index. Accepts a null step argument for non-autofill arrays.- Parameters:
n
- the array indexstep
- the new step
-
contains
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()
-