public class Triplet
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Triplet()
Constructs an empty Triplet.
|
Triplet(double[] array)
Constructs a Triplet from an array of doubles that should contain a uniformly spaced set of values.
|
Triplet(int l)
Constructs a Triplet with the specified length and default values of start (0) and step
(1).
|
Triplet(int l,
double st)
Constructs a Triplet with the specified length and starting value, and with a default value of the
step (1).
|
Triplet(int l,
double st,
double sp)
Constructs a Triplet with the specified length, start, and step.
|
Modifier and Type | Method and Description |
---|---|
double[] |
convertToArray()
Returns an array of doubles generated by the Triplet.
|
static Triplet |
convertToTriplet(double[] values)
Class method that converts a uniformly spaced one-dimensional array of doubles to a Triplet.
|
Triplet |
copy()
Copy by value not by reference
|
double |
getLast()
Returns the last element of the sequence generated by the Triplet.
|
int |
getLength()
Returns the length element of the Triplet.
|
double |
getStart()
Returns the start element of the Triplet.
|
double |
getStep()
Returns the step element of the Triplet.
|
void |
setLength(int l)
Sets the length element of the Triplet.
|
void |
setStart(double st)
Sets the start element of the Triplet.
|
void |
setStep(double sp)
Sets the step element of the Triplet.
|
static boolean |
testUniform(double[] values)
Class method that tests a one-dimensional array to see if it is uniform and can therefore be converted to a
Triplet.
|
java.lang.String |
toAColumn() |
java.lang.String |
toAString() |
public Triplet()
public Triplet(int l, double st, double sp)
l
- The number of elements in the uniformly spaced set.st
- The first value of the set.sp
- The interval (uniform) between values in the set.public Triplet(int l)
l
- The number of elements in the uniformly spaced set.public Triplet(int l, double st)
l
- The number of elements in the uniformly spaced set.st
- The first value of the set.public Triplet(double[] array)
public int getLength()
public double getStart()
public double getStep()
public double getLast()
public void setLength(int l)
public void setStart(double st)
public void setStep(double sp)
public double[] convertToArray()
public static boolean testUniform(double[] values)
public static Triplet convertToTriplet(double[] values)
public final java.lang.String toAString()
public final java.lang.String toAColumn()
public Triplet copy()