IDataSource
, java.io.Serializable
public class DataSourceUniform extends java.lang.Object implements IDataSource, java.io.Serializable
Used principally to provide a set of "x" values for a function or plot.
Modifier and Type | Class | Description |
---|---|---|
static class |
DataSourceUniform.LimitType |
Typed constant that indicates the way limits of the range are interpreted.
|
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
doEnforceBounds |
|
protected DataTag |
tag |
Constructor | Description |
---|---|
DataSourceUniform() |
Default constructor.
|
DataSourceUniform(java.lang.String label,
Dimension dimension) |
|
DataSourceUniform(java.lang.String label,
Dimension dimension,
int nValues,
double xMin,
double xMax) |
Constructs a DataSourceUniform using the indicated number of values
and x range, and INCLUSIVE limits.
|
DataSourceUniform(java.lang.String label,
Dimension dimension,
int nValues,
double xMin,
double xMax,
DataSourceUniform.LimitType typeMin,
DataSourceUniform.LimitType typeMax) |
Constructs a DataSourceUniform using the indicated number of values,
x range, and limit types, with dataInfo indicating that the data have
the given dimension.
|
Modifier and Type | Method | Description |
---|---|---|
IData |
getData() |
Returns the uniformly spaced values.
|
IDataInfo |
getDataInfo() |
|
boolean |
getDoEnforceBounds() |
|
int |
getIndex(double value) |
Returns the index of the x value closest to the argument.
|
int |
getNValues() |
Accessor method for number of values.
|
DataTag |
getTag() |
|
DataSourceUniform.LimitType |
getTypeMax() |
Accessor method for the type of the right limit.
|
DataSourceUniform.LimitType |
getTypeMin() |
Accessor method for the type of the left limit.
|
double |
getXMax() |
Accessor method for the right limit of the range.
|
double |
getXMin() |
Accessor method for the left limit of the range.
|
static void |
main(java.lang.String[] args) |
Main method to demonstrate and check class.
|
void |
setDoEnforceBounds(boolean newDoEnforceBounds) |
|
void |
setNValues(int nValues) |
Sets the number of uniformly spaced values.
|
void |
setTypeMax(DataSourceUniform.LimitType typeMax) |
Mutator method for the type of the right limit.
|
void |
setTypeMin(DataSourceUniform.LimitType typeMin) |
Mutator method for the type of the left limit.
|
void |
setXMax(double xMax) |
Mutator method for the right limit of the range.
|
void |
setXMin(double xMin) |
Mutator method for the left limit of the range.
|
protected final DataTag tag
protected boolean doEnforceBounds
public DataSourceUniform()
public DataSourceUniform(java.lang.String label, Dimension dimension)
public DataSourceUniform(java.lang.String label, Dimension dimension, int nValues, double xMin, double xMax)
public DataSourceUniform(java.lang.String label, Dimension dimension, int nValues, double xMin, double xMax, DataSourceUniform.LimitType typeMin, DataSourceUniform.LimitType typeMax)
public IDataInfo getDataInfo()
getDataInfo
in interface IDataSource
public DataTag getTag()
getTag
in interface IDataSource
public int getIndex(double value)
value
- the double you are testingjava.lang.IllegalArgumentException
- if the argument is outside the defined range.public void setNValues(int nValues)
public int getNValues()
public void setXMin(double xMin)
public double getXMax()
public void setXMax(double xMax)
public double getXMin()
public void setTypeMin(DataSourceUniform.LimitType typeMin)
public DataSourceUniform.LimitType getTypeMin()
public void setTypeMax(DataSourceUniform.LimitType typeMax)
public DataSourceUniform.LimitType getTypeMax()
public IData getData()
getData
in interface IDataSource
public void setDoEnforceBounds(boolean newDoEnforceBounds)
public boolean getDoEnforceBounds()
public static void main(java.lang.String[] args)