public class LWRDataProvider extends java.lang.Object implements IDataProvider
An implementation of the IDataProvider. This class is used to store State point data, usually for material decompositions or powers, that can be used to store and display changes in value overtime across different features.
Constructor and Description |
---|
LWRDataProvider()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(LWRData data,
double time)
Adds a IData piece, keyed on the feature and timeStep, to the dataTree.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(LWRDataProvider otherObject)
Deep copies the contents of the object.
|
boolean |
equals(java.lang.Object otherObject)
Equality check.
|
double |
getCurrentTime()
Returns the current time step.
|
java.util.ArrayList<IData> |
getDataAtCurrentTime(java.lang.String feature)
(non-Javadoc)
|
java.util.ArrayList<java.lang.String> |
getFeatureList()
(non-Javadoc)
|
java.util.ArrayList<java.lang.String> |
getFeaturesAtCurrentTime()
(non-Javadoc)
|
int |
getNumberOfTimeSteps()
(non-Javadoc)
|
java.lang.String |
getSourceInfo()
(non-Javadoc)
|
java.util.ArrayList<java.lang.Double> |
getTimes()
(non-Javadoc)
|
int |
getTimeStep(double time)
(non-Javadoc)
|
java.lang.String |
getTimeUnits()
(non-Javadoc)
|
int |
hashCode()
The hashcode.
|
void |
removeAllDataFromFeature(java.lang.String feature)
Removes the feature and all associated IData from the dataTree at all
time steps.
|
void |
setSourceInfo(java.lang.String sourceInfo)
Sets the sourceInfo.
|
void |
setTime(double step)
(non-Javadoc)
|
void |
setTimeUnits(java.lang.String timeUnit)
Sets the time units.
|
public void setSourceInfo(java.lang.String sourceInfo)
Sets the sourceInfo. Can not be null or the empty string. Strings passed will be trimmed before being set.
sourceInfo
- The sourceInfo to set.
public void addData(LWRData data, double time)
Adds a IData piece, keyed on the feature and timeStep, to the dataTree. If the feature exists in the tree, it will append to the end of the list.
data
- The data to add.
time
- public void removeAllDataFromFeature(java.lang.String feature)
Removes the feature and all associated IData from the dataTree at all time steps. If a user wishes to remove a single piece of IData from the tree, then use the appropriate getData operation on that feature and manipulate the data that way.
feature
- The feature.
public void copy(LWRDataProvider otherObject)
Deep copies the contents of the object.
otherObject
- The object to be copied.
public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in class java.lang.Object
The newly instantiated copied object.
public void setTimeUnits(java.lang.String timeUnit)
Sets the time units.
timeUnit
- The time unit to be set.
public boolean equals(java.lang.Object otherObject)
Equality check. Returns true if equals, false otherwise.
equals
in class java.lang.Object
otherObject
- Object to equate.
True if equal, false otherwise.
public int hashCode()
The hashcode.
hashCode
in class java.lang.Object
the hash.
public java.util.ArrayList<java.lang.String> getFeatureList()
getFeatureList
in interface IDataProvider
The list of features.
IDataProvider.getFeatureList()
public int getNumberOfTimeSteps()
getNumberOfTimeSteps
in interface IDataProvider
The number of time steps.
IDataProvider.getNumberOfTimeSteps()
public void setTime(double step)
setTime
in interface IDataProvider
step
- The time step to set.
IDataProvider.setTime(double step)
public java.util.ArrayList<IData> getDataAtCurrentTime(java.lang.String feature)
getDataAtCurrentTime
in interface IDataProvider
feature
- The feature for the IData.
The returned IData.
IDataProvider.getDataAtCurrentTime(String feature)
public java.lang.String getSourceInfo()
getSourceInfo
in interface IDataProvider
The source information.
IDataProvider.getSourceInfo()
public java.util.ArrayList<java.lang.String> getFeaturesAtCurrentTime()
getFeaturesAtCurrentTime
in interface IDataProvider
The returned list of features at the current time step.
IDataProvider.getFeaturesAtCurrentTime()
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.
IDataProvider.getTimes()
public int getTimeStep(double time)
getTimeStep
in interface IDataProvider
IDataProvider.getTimeStep(double time)
public java.lang.String getTimeUnits()
getTimeUnits
in interface IDataProvider
The time unit.
IDataProvider.getTimeUnits()
public double getCurrentTime()
Returns the current time step.
The current time step.