public class DataSet extends AbstractGenericTask implements Saveable, REpiceaUIObject
Modifier and Type | Class and Description |
---|---|
protected static class |
DataSet.ActionType |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
fieldNames |
protected java.util.List<java.lang.Class<?>> |
fieldTypes |
protected java.util.List<Observation> |
observations |
isCancelled
Modifier | Constructor and Description |
---|---|
|
DataSet(java.util.List<java.lang.String> fieldNames)
An empty dataset ready to be filled with observations.
|
protected |
DataSet(java.lang.String filename) |
|
DataSet(java.lang.String filename,
boolean autoLoad)
General constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String name,
java.lang.Object[] field) |
void |
addObservation(java.lang.Object[] observationFrame) |
protected void |
doThisJob()
This method is the inner part of the doInBackground method.
|
protected Matrix |
getDummyMatrix(java.util.List possibleValues,
int fieldIndex) |
java.util.List<java.lang.String> |
getFieldNames()
Returns the field names in a list.
|
protected java.lang.Class |
getFieldTypeOfThisField(int i) |
protected java.lang.Class |
getFieldTypeOfThisField(java.lang.String fieldName) |
java.util.List<java.lang.Class<?>> |
getFieldTypes() |
protected int |
getIndexOfThisField(java.lang.String fieldName)
This method returns the index of a particular field.
|
int |
getNumberOfObservations()
This method returns the number of observations in the dataset.
|
java.util.List<Observation> |
getObservations()
Returns the observations of the data set.
|
protected java.util.List |
getPossibleValuesInThisField(int j)
This method returns all the possible values in this field.
|
REpiceaTable |
getUI()
This method returns the GUI interface of the class that implements this interface.
|
protected java.lang.Object |
getValueAt(int i,
int j)
This method returns any object in the dataset at row i and column j.
|
protected java.lang.Object |
getValueAt(int i,
java.lang.String fieldName) |
protected Matrix |
getVectorOfThisField(int j) |
protected Matrix |
getVectorOfThisField(java.lang.String fieldName) |
void |
indexFieldType()
Indexes the different field types.
|
boolean |
isVisible()
This method returns true if the GUI is visible.
|
void |
save(java.lang.String filename)
This method saves the records in a file denominated by the filename parameter.
|
protected void |
setValueAt(int i,
int j,
java.lang.Object newValue,
DataSet.ActionType actionType) |
protected void |
setValueAt(int i,
java.lang.String fieldName,
java.lang.Object value,
DataSet.ActionType actionType) |
void |
sortObservations(java.util.List<java.lang.Integer> fieldIndices)
This method sorts the data according to the fields represented by the indices in fieldIndices parameter.
|
cancel, doInBackground, done, getFailureReason, getName, hasBeenCancelled, isCorrectlyTerminated, isVerbose, setCorrectlyTerminated, setFailureReason, setName, toString
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
protected java.util.List<java.lang.String> fieldNames
protected java.util.List<java.lang.Class<?>> fieldTypes
protected java.util.List<Observation> observations
protected DataSet(java.lang.String filename)
public DataSet(java.lang.String filename, boolean autoLoad)
filename
- the name of the file to be readautoLoad
- true if the file is to be read now. Typically, this boolean is set to false when the swingworker is
launched from a window that retrieves some events.public DataSet(java.util.List<java.lang.String> fieldNames)
fieldNames
- a List of String instances that represent the field namesprotected java.lang.Object getValueAt(int i, int j)
i
- the index of the rowj
- the index of the columnprotected java.lang.Object getValueAt(int i, java.lang.String fieldName)
protected void setValueAt(int i, int j, java.lang.Object newValue, DataSet.ActionType actionType)
protected void setValueAt(int i, java.lang.String fieldName, java.lang.Object value, DataSet.ActionType actionType)
public void indexFieldType()
protected int getIndexOfThisField(java.lang.String fieldName)
fieldName
- the name of the fieldpublic void sortObservations(java.util.List<java.lang.Integer> fieldIndices)
fieldIndices
- a List of field indicespublic int getNumberOfObservations()
protected java.lang.Class getFieldTypeOfThisField(int i)
protected java.lang.Class getFieldTypeOfThisField(java.lang.String fieldName)
protected Matrix getVectorOfThisField(java.lang.String fieldName)
protected Matrix getVectorOfThisField(int j)
protected java.util.List getPossibleValuesInThisField(int j)
j
- the index of the field.protected Matrix getDummyMatrix(java.util.List possibleValues, int fieldIndex)
public void addObservation(java.lang.Object[] observationFrame)
public void addField(java.lang.String name, java.lang.Object[] field)
public void save(java.lang.String filename) throws java.io.IOException
Saveable
protected void doThisJob() throws java.lang.Exception
AbstractGenericTask
doThisJob
in class AbstractGenericTask
java.lang.Exception
public java.util.List<java.lang.String> getFieldNames()
public java.util.List<java.lang.Class<?>> getFieldTypes()
public REpiceaTable getUI()
REpiceaUIObject
getUI
in interface REpiceaUIObject
public boolean isVisible()
REpiceaUIObject
isVisible
in interface REpiceaUIObject
public java.util.List<Observation> getObservations()