Class ArrayDataSet
- java.lang.Object
-
- idare.imagenode.Interfaces.DataSets.DataSet
-
- idare.imagenode.Data.BasicDataTypes.ArrayData.ArrayDataSet
-
- All Implemented Interfaces:
IDAREService
,Serializable
public class ArrayDataSet extends DataSet
An Abstract basis class for item based datasets. The specific layout can be individually adjusted.- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Vector<ColorMap>
colormaps
protected int
columncount
protected Vector<String>
columnLabels
A Vector indicating the labels of each columnprotected HashMap<String,ArrayNodeData>
Data
static String
DataSetType
static String
DEFAULT_SERIES_NAME
protected ArrayNodeData
defaultEntry
protected boolean[]
emptycolumns
protected HashMap<String,String>
NodeLabels
-
Fields inherited from class idare.imagenode.Interfaces.DataSets.DataSet
DATASETCOLORSCALE, DATASETDESCRIPTION, dataSetID, datasetProperties, Description, isdiscreet, isnumeric, isstring, MaxValue, MinValue, numericstrings, propertyOptions, PROPERTYOPTIONSAVAILABLE, useTwoColHeaders, Valueset
-
-
Constructor Summary
Constructors Constructor Description ArrayDataSet()
Basic constructor using the default settings.ArrayDataSet(int DataSetID, boolean useTwoCols, Properties properties)
Constructor using an ID, indication for twoColumn use in the datafile, and a properties collectionArrayDataSet(String DataSetName)
Basic constructor using a specific DataSetName
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
determineNonEmptyColumns(IDAREWorkbook WB)
Determine the columns which are non empty, This can be derived from the Header column as all columns which are set have to contain a label.Vector<ColorMap>
getColorMapOptions()
String
getColumnLabel(int column)
Get the Label for a specific Column in the data, or null if it does not exist, or there is no clear label.DataContainer
getContainerForID(String ID)
Get the appropriate DataContainer for an ID.NodeData
getDataForID(String NodeID)
Get theNodeData
for a specific ID.String
getDataSetTypeName()
Get the general Name for this Type of DataSetNodeData
getDefaultData()
Get a default NodeData object for this datasetprotected static Properties
getDefaultProperties()
Get the Default Properties (Description/Colorscale etc) for this dataset.Vector<Comparable>
getHeaders()
Get the Headers in this DataSetint
getID()
Get the ID of this set.DataContainer
getLayoutContainer(DataSetLayoutProperties props)
Get a sample container for Layout purposesSet<String>
getNodeIDs()
Get the set of Node IDs contained in thisDataSet
.boolean
isColumnSet(int column)
Check whether a specific column is set or empty.void
preProcessWorkBook(IDAREWorkbook WB)
Do preprocessing for the setup Process.void
readWorkBookData(IDAREWorkbook WB)
Read the Data for this workbook into the dataset.protected void
reset()
reset this Dataset to a stage as if it would have been just initialized.void
setID(int id)
Set the ID of this DataSetvoid
setTwoColumnHeaders(boolean twocols)
Define what type of headers are being used.String
writeDataSet()
Essentially a toString function to write this dataset.-
Methods inherited from class idare.imagenode.Interfaces.DataSets.DataSet
addPropertyOption, getDataSetDescriptionPane, getPreferredposition, getPropertyOptions, getYAxisLimits, isFlexibility, loadWorkBook, removePropertyOption, setProperties, setProperties, setPropertyOptionsUnchecked, setupPropertyOptions, setupWorkBook, skipLabels, toString
-
-
-
-
Field Detail
-
DataSetType
public static String DataSetType
-
Data
protected HashMap<String,ArrayNodeData> Data
-
defaultEntry
protected ArrayNodeData defaultEntry
-
columncount
protected int columncount
-
emptycolumns
protected boolean[] emptycolumns
-
DEFAULT_SERIES_NAME
public static final String DEFAULT_SERIES_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArrayDataSet
public ArrayDataSet()
Basic constructor using the default settings.
-
ArrayDataSet
public ArrayDataSet(String DataSetName)
Basic constructor using a specific DataSetName- Parameters:
DataSetName
- The name of the Dataset
-
ArrayDataSet
public ArrayDataSet(int DataSetID, boolean useTwoCols, Properties properties)
Constructor using an ID, indication for twoColumn use in the datafile, and a properties collection- Parameters:
DataSetID
- The ID of theArrayDataSet
useTwoCols
- Whether to use individual columns for label and ID or use one column for bothproperties
- properties of thisArrayDataSet
-
-
Method Detail
-
getDefaultProperties
protected static Properties getDefaultProperties()
Get the Default Properties (Description/Colorscale etc) for this dataset.- Returns:
- The default properties of this Dataset
-
preProcessWorkBook
public void preProcessWorkBook(IDAREWorkbook WB) throws WrongFormat
Description copied from class:DataSet
Do preprocessing for the setup Process. This function is called before the actual data setup.- Overrides:
preProcessWorkBook
in classDataSet
- Parameters:
WB
- The WorkBook to be preprocessed- Throws:
WrongFormat
- if the Workbook does not have a valid Layouting format, or if the WorkBook does not stick to any possible Data Types.
-
reset
protected void reset()
Description copied from class:DataSet
reset this Dataset to a stage as if it would have been just initialized.
-
readWorkBookData
public void readWorkBookData(IDAREWorkbook WB) throws WrongFormat, DuplicateIDException
Description copied from class:DataSet
Read the Data for this workbook into the dataset. This function should also remove any inappropriate property options, as those can only be determined now.- Specified by:
readWorkBookData
in classDataSet
- Parameters:
WB
- The IDAREWorkbook to read from.- Throws:
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.
-
setTwoColumnHeaders
public void setTwoColumnHeaders(boolean twocols)
Description copied from class:DataSet
Define what type of headers are being used.- Overrides:
setTwoColumnHeaders
in classDataSet
- Parameters:
twocols
- whether to use two column headers when parsing
-
getDataForID
public NodeData getDataForID(String NodeID)
Description copied from class:DataSet
Get theNodeData
for a specific ID.- Specified by:
getDataForID
in classDataSet
- Parameters:
NodeID
- The ID of theNodeData
requested.- Returns:
- the requested NodeData (if it is not present an appropriate empty entry should be returned.)
-
setID
public void setID(int id)
Description copied from class:DataSet
Set the ID of this DataSet
-
getID
public int getID()
Description copied from class:DataSet
Get the ID of this set.
-
getNodeIDs
public Set<String> getNodeIDs()
Description copied from class:DataSet
Get the set of Node IDs contained in thisDataSet
.- Specified by:
getNodeIDs
in classDataSet
- Returns:
- the set of node IDs in this
DataSet
-
writeDataSet
public String writeDataSet()
Essentially a toString function to write this dataset.- Returns:
- a string representing this dataset
-
getDefaultData
public NodeData getDefaultData()
Description copied from class:DataSet
Get a default NodeData object for this dataset- Specified by:
getDefaultData
in classDataSet
- Returns:
- the Default Data used in this dataset.
-
getContainerForID
public DataContainer getContainerForID(String ID)
Description copied from class:DataSet
Get the appropriate DataContainer for an ID.- Specified by:
getContainerForID
in classDataSet
- Parameters:
ID
- the ID for which to get aDataContainer
- Returns:
- a Container for a specific ID
-
getLayoutContainer
public DataContainer getLayoutContainer(DataSetLayoutProperties props) throws WrongDatasetTypeException
Description copied from class:DataSet
Get a sample container for Layout purposes- Specified by:
getLayoutContainer
in classDataSet
- Parameters:
props
- TheDataSetLayoutProperties
for which to get aDataContainer
.- Returns:
- a sample container using Default data.
- Throws:
WrongDatasetTypeException
- If the providedDataSetLayoutProperties
cannot be used with this Dataset
-
getDataSetTypeName
public String getDataSetTypeName()
Description copied from class:DataSet
Get the general Name for this Type of DataSet- Specified by:
getDataSetTypeName
in classDataSet
- Returns:
- The Type of Dataset (as String)
-
getColorMapOptions
public Vector<ColorMap> getColorMapOptions()
Description copied from class:DataSet
Get theColorMap
s available for thisDataSet
The objects in this vector should always be the same (i.e. two successive calls should yield colormaps that can be compare with ==)- Specified by:
getColorMapOptions
in classDataSet
- Returns:
- A collection of
ColorMap
s available to thisDataSet
-
isColumnSet
public boolean isColumnSet(int column)
Check whether a specific column is set or empty.- Parameters:
column
- the index of the column to check (this index excludes the ID and label columns and starts with the first data column as 0)- Returns:
- whether the given column has values
-
getColumnLabel
public String getColumnLabel(int column)
Get the Label for a specific Column in the data, or null if it does not exist, or there is no clear label.- Parameters:
column
- get the label for the requested column index. if isColumnSet(column) returns false, getColumnLabel(column) will return null- Returns:
- the label for the requested Column, or null if the header is not set.
-
getHeaders
public Vector<Comparable> getHeaders()
Description copied from class:DataSet
Get the Headers in this DataSet- Specified by:
getHeaders
in classDataSet
- Returns:
- return all headers (either Double or String) in this
DataSet
.
-
determineNonEmptyColumns
protected void determineNonEmptyColumns(IDAREWorkbook WB)
Determine the columns which are non empty, This can be derived from the Header column as all columns which are set have to contain a label.- Parameters:
WB
- TheIDAREWorkbook
to determine empty columns from.
-
-