Class MultiArrayDataSet
- java.lang.Object
-
- idare.imagenode.Interfaces.DataSets.DataSet
-
- idare.imagenode.Data.BasicDataTypes.MultiArrayData.MultiArrayDataSet
-
- All Implemented Interfaces:
IDAREService
,Serializable
public class MultiArrayDataSet extends DataSet
Class to provide a basic setting for MultiArray Datasets. This class will read in multiple sheets from a sourcefile, and generate Data structures accordingly. If the headers of such a sheet are numeric values, the corresponding layouts have to treat the data quite differently to to a string header based dataset, as numeric values indicate continous data, while string headers indicate discrete steps.- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Vector<Comparable>
allHeaders
protected Collection<ColorMap>
colormaps
protected HashMap<String,MultiArrayNodeData>
Data
protected MultiArrayNodeData
defaultData
protected HashMap<String,Vector<Comparable>>
Headerlines
boolean
mixedheaders
Mixed headers can appear due to e.g.protected static String
MultiArrayTypeName
boolean
numericheaders
Indicator whether numeric headers are usedprotected Vector<String>
SheetNames
boolean
stringheaders
Indicator whether String headers are used-
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 MultiArrayDataSet()
Basic Constructor, generating an empty dataset.MultiArrayDataSet(int DataSetID, boolean useTowColHeaders, Properties DataSetProperties)
Constructor using an id, a two column indicator and the dataset properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector<ColorMap>
getColorMapOptions()
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 for aMultiArrayDataSet
.Vector<Comparable>
getHeaders()
Get all values present in the headers of this DataSetVector<Comparable>
getHeadersForSheet(String SheetName)
Get the Headers (Either String or Double, so handle with care) for a specific sheet in this Dataset, based on the sheet name.int
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
.Vector<String>
getSetNames()
Get the names of the Sheets represented in this DataSetvoid
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 DataSet-
Methods inherited from class idare.imagenode.Interfaces.DataSets.DataSet
addPropertyOption, getDataSetDescriptionPane, getPreferredposition, getPropertyOptions, getYAxisLimits, isFlexibility, loadWorkBook, preProcessWorkBook, removePropertyOption, setProperties, setProperties, setPropertyOptionsUnchecked, setTwoColumnHeaders, setupPropertyOptions, setupWorkBook, skipLabels, toString
-
-
-
-
Field Detail
-
MultiArrayTypeName
protected static String MultiArrayTypeName
-
Data
protected HashMap<String,MultiArrayNodeData> Data
-
Headerlines
protected HashMap<String,Vector<Comparable>> Headerlines
-
stringheaders
public boolean stringheaders
Indicator whether String headers are used
-
numericheaders
public boolean numericheaders
Indicator whether numeric headers are used
-
mixedheaders
public boolean mixedheaders
Mixed headers can appear due to e.g. numeric strings
-
defaultData
protected MultiArrayNodeData defaultData
-
colormaps
protected Collection<ColorMap> colormaps
-
allHeaders
protected Vector<Comparable> allHeaders
-
-
Constructor Detail
-
MultiArrayDataSet
public MultiArrayDataSet()
Basic Constructor, generating an empty dataset.
-
MultiArrayDataSet
public MultiArrayDataSet(int DataSetID, boolean useTowColHeaders, Properties DataSetProperties)
Constructor using an id, a two column indicator and the dataset properties.- Parameters:
DataSetID
- The ID of the DatasetuseTowColHeaders
- Whether to use two columns for label and id or only one for bothDataSetProperties
- some properties of the dataset
-
-
Method Detail
-
getDefaultProperties
protected static Properties getDefaultProperties()
Get the default properties for aMultiArrayDataSet
.- Returns:
- The default properties of a
MultiArrayDataSet
-
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
-
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.
-
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
-
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
-
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.
-
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)
-
getSetNames
public Vector<String> getSetNames()
Get the names of the Sheets represented in this DataSet- Returns:
- a
Vector
of Strings with the names of the Sheets in this DataSet
-
getHeadersForSheet
public Vector<Comparable> getHeadersForSheet(String SheetName)
Get the Headers (Either String or Double, so handle with care) for a specific sheet in this Dataset, based on the sheet name.- Parameters:
SheetName
- the Sheetname for which to obtain headers- Returns:
- the HeaderColumn for the requested Sheet
-
getHeaders
public Vector<Comparable> getHeaders()
Get all values present in the headers of this DataSet- Specified by:
getHeaders
in classDataSet
- Returns:
- a Vector of all headers in this dataset.
-
reset
protected void reset()
Description copied from class:DataSet
reset this Dataset to a stage as if it would have been just initialized.
-
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
-
-