public abstract class DataSet extends Object implements IDAREService, Serializable
DataSet
is a storage for data. This abstract class provides several utility methods which are common to most datasets (such as the determination of some properties for datasets).Modifier and Type | Field and Description |
---|---|
static String |
DATASETCOLORSCALE |
static String |
DATASETDESCRIPTION |
protected int |
dataSetID |
protected DataSetLayoutProperties |
datasetProperties
The properties to be used for this dataset, need to be set during reading of data.
|
String |
Description
The Description of this Dataset.
|
boolean |
isdiscreet
An Indicator whether this is a discreet data set (i.e.
|
boolean |
isnumeric
An Indicator whether the dataset uses numeric representation
|
boolean |
isstring
An Indicator whether the dataset uses numeric representation
|
protected Double |
MaxValue |
protected Double |
MinValue |
boolean |
numericstrings
an indicator whether the dataset uses numeric data represented by strings
|
protected Vector<DataSetLayoutProperties> |
propertyOptions |
static String |
PROPERTYOPTIONSAVAILABLE |
boolean |
useTwoColHeaders
An Indicator whether this dataset uses one or two columns to provide label/ID
|
protected Vector<Comparable> |
Valueset |
Constructor and Description |
---|
DataSet() |
DataSet(int DataSetID,
boolean useTowColHeaders,
Properties props) |
Modifier and Type | Method and Description |
---|---|
boolean |
addPropertyOption(DataSetLayoutProperties propsToAdd)
Add Property options to this Dataset, and indicate whether the addition was successful.
|
abstract Vector<ColorMap> |
getColorMapOptions()
|
abstract DataContainer |
getContainerForID(String ID)
Get the appropriate DataContainer for an ID.
|
abstract NodeData |
getDataForID(String NodeID)
Get the
NodeData for a specific ID. |
JPanel |
getDataSetDescriptionPane(JScrollPane Legend,
String DataSetLabel,
ColorMap map)
Get a Description of this DataSet in the form of a
JPanel . |
abstract String |
getDataSetTypeName()
Get the general Name for this Type of DataSet
|
abstract NodeData |
getDefaultData()
Get a default NodeData object for this dataset
|
protected static Properties |
getDefaultProperties() |
abstract Vector<Comparable> |
getHeaders()
Get the Headers in this DataSet
|
abstract int |
getID()
Get the ID of this set.
|
abstract DataContainer |
getLayoutContainer(DataSetLayoutProperties properties)
Get a sample container for Layout purposes
|
abstract Set<String> |
getNodeIDs()
Get the set of Node IDs contained in this
DataSet . |
Localisation.Position |
getPreferredposition()
Get the preferred layout localisation of this dataset
|
Vector<DataSetLayoutProperties> |
getPropertyOptions()
Get the selection of different properties available for this dataset
|
Double[] |
getYAxisLimits()
Get the limits (minimum and maximum value) if this is a numeric dataset.
|
boolean |
isFlexibility()
Return the flexibility of this dataset for layout purposes.
|
boolean |
loadWorkBook(IDAREWorkbook WB)
This function loads calls the implementing classes function setupWorkBook to interpret the Workbook provided and
tests, whether there are viable
DataSetLayoutProperties in IDARE that can be used with this DataSet and the given Workbook. |
void |
preProcessWorkBook(IDAREWorkbook WB)
Do preprocessing for the setup Process.
|
abstract void |
readWorkBookData(IDAREWorkbook WB)
Read the Data for this workbook into the dataset.
|
boolean |
removePropertyOption(DataSetLayoutProperties propsToRemove)
Remove the given PropertyOptions from this dataset.
|
protected void |
reset()
reset this Dataset to a stage as if it would have been just initialized.
|
abstract void |
setID(int id)
Set the ID of this DataSet
|
void |
setProperties(DataSetLayoutProperties properties)
Set the
DataSetLayoutProperties currently used for this dataset |
void |
setProperties(Properties props) |
void |
setPropertyOptionsUnchecked(Collection<DataSetLayoutProperties> options)
Sets the Options potentially available to this Dataset.
|
void |
setTwoColumnHeaders(boolean twocols)
Define what type of headers are being used.
|
void |
setupPropertyOptions()
Set up the property options for this
DataSet . |
void |
setupWorkBook(IDAREWorkbook WB)
Set up the data properties from the provided workbook and read the data into this dataset.
|
IDARECell |
skipLabels(Iterator<IDARECell> currentiterator)
Skip the Cells containing the labels from a cell iterator
|
String |
toString()
The String representation of a DataSet is its description.
|
public static String DATASETCOLORSCALE
public static String DATASETDESCRIPTION
public static final String PROPERTYOPTIONSAVAILABLE
public boolean isnumeric
public boolean isstring
public boolean numericstrings
public boolean isdiscreet
public boolean useTwoColHeaders
public String Description
protected DataSetLayoutProperties datasetProperties
protected Vector<DataSetLayoutProperties> propertyOptions
protected Vector<Comparable> Valueset
protected int dataSetID
protected Double MinValue
protected Double MaxValue
public DataSet()
public DataSet(int DataSetID, boolean useTowColHeaders, Properties props)
protected static Properties getDefaultProperties()
public void setProperties(Properties props)
public final boolean loadWorkBook(IDAREWorkbook WB) throws WrongFormat, DuplicateIDException, IOException
DataSetLayoutProperties
in IDARE that can be used with this DataSet and the given Workbook.WB
- The Workbook this DataSet should use to obtain dataWrongFormat
- if none of the readers can read the file properly.DuplicateIDException
- if there are duplicate ids in the files.IOException
- if there is a problem with the provided file.protected void reset()
public void setTwoColumnHeaders(boolean twocols)
twocols
- whether to use two column headers when parsingpublic final void setupWorkBook(IDAREWorkbook WB) throws WrongFormat, DuplicateIDException
WB
- The WorkBookWrongFormat
- if there are problems with the format of the data in the Workbook.DuplicateIDException
- if there are duplicate IDs in the Workbook (e.g. sheets which have the same identifier twice).public void setupPropertyOptions() throws WrongFormat
DataSet
.WrongFormat
- if there are no layout properties fitting to this type of dataset.public IDARECell skipLabels(Iterator<IDARECell> currentiterator)
currentiterator
- the Celliterator for a specific row.IDARECell
after skippning columns for the labels.public boolean isFlexibility()
public Localisation.Position getPreferredposition()
public String toString()
public void setProperties(DataSetLayoutProperties properties)
DataSetLayoutProperties
currently used for this datasetproperties
- The DataSetLayoutProperties
to use for layout of this DataSet
public final Vector<DataSetLayoutProperties> getPropertyOptions()
public final void setPropertyOptionsUnchecked(Collection<DataSetLayoutProperties> options)
options
- The possible DataSetLayoutProperties
for this Datasetpublic final boolean addPropertyOption(DataSetLayoutProperties propsToAdd)
propsToAdd
- the DataSetLayoutProperties
to add to this dataset.public Double[] getYAxisLimits()
public JPanel getDataSetDescriptionPane(JScrollPane Legend, String DataSetLabel, ColorMap map)
JPanel
.
The function provides the Legend this is associated with (to be able to adjust the size of components for proper scaling).Legend
- The scroll pane to use for width adjustmentsDataSetLabel
- the label assigned to this dataset for description generationmap
- the colormap assigned to this dataset for layoutingpublic abstract NodeData getDataForID(String NodeID)
NodeData
for a specific ID.NodeID
- The ID of the NodeData
requested.public abstract void setID(int id)
id
- The ID assigned to this DataSet
public abstract int getID()
DataSet
public abstract Set<String> getNodeIDs()
DataSet
.DataSet
public abstract void readWorkBookData(IDAREWorkbook WB) throws WrongFormat, DuplicateIDException
WB
- The IDAREWorkbook to read from.WrongFormat
- If there is a format problem in the Workbook (mix numeric/string, invalid string o.รค.)DuplicateIDException
- If there are duplicate IDs in the Workbook that is being loaded.public abstract DataContainer getContainerForID(String ID)
ID
- the ID for which to get a DataContainer
public abstract DataContainer getLayoutContainer(DataSetLayoutProperties properties) throws WrongDatasetTypeException
properties
- The DataSetLayoutProperties
for which to get a DataContainer
.WrongDatasetTypeException
- If the provided DataSetLayoutProperties
cannot be used with this Datasetpublic abstract NodeData getDefaultData()
public abstract Vector<Comparable> getHeaders()
DataSet
.public final boolean removePropertyOption(DataSetLayoutProperties propsToRemove)
propsToRemove
- The DataSetLayoutProperties
option to removepublic abstract String getDataSetTypeName()
public void preProcessWorkBook(IDAREWorkbook WB) throws WrongFormat
WB
- The WorkBook to be preprocessedWrongFormat
- if the Workbook does not have a valid Layouting format, or if the WorkBook does not stick to any possible Data Types.Copyright © 2018. All rights reserved.