public class CSVDataProvider extends java.lang.Object implements IDataProvider
Constructor and Description |
---|
CSVDataProvider()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addData(double time,
IData data)
Adds a single data item at a specified time.
|
void |
addData(IData data)
Adds a single data item with no specified time.
|
void |
addDataSeries(double time,
java.util.List<IData> dataSeries)
Adds a data series to the data set at a specified time.
|
void |
addDataSeries(java.util.List<IData> dataSeries)
Adds a data series with no specified time.
|
java.util.ArrayList<IData> |
getDataAtCurrentTime(java.lang.String feature)
Returns the series of data at the set current time for a specified
feature, or null if data could not be found.
|
int |
getDataHeight()
Returns the dataHeight
|
double |
getDataMax()
Returns the data maximum
|
double |
getDataMin()
Returns the data minimum
|
int |
getDataWidth()
Returns the dataWidth
|
java.util.ArrayList<java.lang.String> |
getFeatureList()
Returns the lists of features across all times
|
java.util.ArrayList<java.lang.String> |
getFeaturesAtCurrentTime()
Returns the features at the current time
|
java.util.ArrayList<java.lang.String> |
getIndependentVariables()
Returns an ArrayList of feature Strings of independent variables
|
int |
getNumberOfTimeSteps()
Returns the number of time steps
|
double[] |
getPositionAtCurrentTime(java.lang.String independentVar)
Returns the specified position/independent variable from the provider
|
java.lang.String |
getSourceInfo()
Returns the source
|
java.util.ArrayList<java.lang.Double> |
getTimes()
Returns the times in the data set
|
java.util.ArrayList<java.lang.Double> |
getTimesForFeature(java.lang.String feature)
Gets the list of times that the feature is present at.
|
int |
getTimeStep(double time)
Returns the integer time step at the given time
|
java.lang.String |
getTimeUnits()
Returns the time units
|
double[] |
getUncertaintiesAtCurrentTime(java.lang.String feature)
Returns the uncertainties of each IData at the current time for a
specified
|
double[] |
getValuesAtCurrentTime(java.lang.String feature)
Returns the values of each IData at the current time for a specified
feature.
|
void |
removeDataSeries(double time,
java.lang.String feature)
Removes a data series at a specified time with a specified feature.
|
void |
setDataHeight(int dataHeight)
Set the dataHeight for a matrix (Contour plot)
|
void |
setDataMax(double maximum)
Set the data maximum (Contour plot)
|
void |
setDataMin(double minimum)
Set the data minimum (Contour plot)
|
void |
setDataWidth(int dataWidth)
Set the dataWidth for a matrix (Contour plot)
|
void |
setFeatureAsIndependentVariable(java.lang.String independent)
Sets a feature as a independent variable/position across all times (May
need to check that the independent variable exists across all times.
|
void |
setSource(java.lang.String source)
Sets the source
|
void |
setTime(double step)
Sets the currentTime based on the specified step/time.
|
void |
setTimeForFeature(double prevTime,
double newTime,
java.lang.String feature)
Sets a new time for a specified time and feature.
|
void |
setTimeForFeature(double newTime,
java.lang.String feature)
Sets a new time for a specified feature and assumes the previous time was
defaultTime
|
void |
setTimeUnits(java.lang.String timeUnits)
Sets the time units
|
public void addData(double time, IData data)
time
- data
- public void addData(IData data)
data
- public void addDataSeries(double time, java.util.List<IData> dataSeries)
time
- dataSeries
- public void addDataSeries(java.util.List<IData> dataSeries)
dataSeries
- public void removeDataSeries(double time, java.lang.String feature)
time
- feature
- public void setTimeUnits(java.lang.String timeUnits)
timeUnits
- public void setSource(java.lang.String source)
source
- public void setTime(double step)
setTime
in interface IDataProvider
step
- The time step to set.
public void setTimeForFeature(double prevTime, double newTime, java.lang.String feature)
prevTime
- newTime
- feature
- public void setTimeForFeature(double newTime, java.lang.String feature)
newTime
- feature
- public void setFeatureAsIndependentVariable(java.lang.String independent)
independent
- public void setDataWidth(int dataWidth)
dataWidth
- public void setDataHeight(int dataHeight)
dataHeight
- public void setDataMin(double minimum)
minimum
- public void setDataMax(double maximum)
maximum
- public java.util.ArrayList<java.lang.String> getIndependentVariables()
public java.util.ArrayList<java.lang.Double> getTimesForFeature(java.lang.String feature)
feature
- public java.util.ArrayList<java.lang.String> getFeatureList()
getFeatureList
in interface IDataProvider
The list of features.
public int getNumberOfTimeSteps()
getNumberOfTimeSteps
in interface IDataProvider
The number of time steps.
public java.util.ArrayList<IData> getDataAtCurrentTime(java.lang.String feature)
getDataAtCurrentTime
in interface IDataProvider
feature
- The feature for the IData.
The returned IData.
public double[] getValuesAtCurrentTime(java.lang.String feature)
feature
- public double[] getUncertaintiesAtCurrentTime(java.lang.String feature)
feature
- public double[] getPositionAtCurrentTime(java.lang.String independentVar)
independentVar
- public int getDataWidth()
public int getDataHeight()
public double getDataMin()
public double getDataMax()
public java.lang.String getSourceInfo()
getSourceInfo
in interface IDataProvider
The source information.
public java.util.ArrayList<java.lang.String> getFeaturesAtCurrentTime()
getFeaturesAtCurrentTime
in interface IDataProvider
The returned list of features at the current time step.
public java.util.ArrayList<java.lang.Double> getTimes()
getTimes
in interface IDataProvider
An arraylist of times in order from least to greatest. This operation does not allow the user to change the order of this list.
public int getTimeStep(double time)
getTimeStep
in interface IDataProvider
time
- The time whose timestep will be found.public java.lang.String getTimeUnits()
getTimeUnits
in interface IDataProvider
The time unit.