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>allHeadersprotected Collection<ColorMap>colormapsprotected HashMap<String,MultiArrayNodeData>Dataprotected MultiArrayNodeDatadefaultDataprotected HashMap<String,Vector<Comparable>>HeaderlinesbooleanmixedheadersMixed headers can appear due to e.g.protected static StringMultiArrayTypeNamebooleannumericheadersIndicator whether numeric headers are usedprotected Vector<String>SheetNamesbooleanstringheadersIndicator 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()DataContainergetContainerForID(String ID)Get the appropriate DataContainer for an ID.NodeDatagetDataForID(String NodeID)Get theNodeDatafor a specific ID.StringgetDataSetTypeName()Get the general Name for this Type of DataSetNodeDatagetDefaultData()Get a default NodeData object for this datasetprotected static PropertiesgetDefaultProperties()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.intgetID()Get the ID of this set.DataContainergetLayoutContainer(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 DataSetvoidreadWorkBookData(IDAREWorkbook WB)Read the Data for this workbook into the dataset.protected voidreset()reset this Dataset to a stage as if it would have been just initialized.voidsetID(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:DataSetGet the appropriate DataContainer for an ID.- Specified by:
getContainerForIDin 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:DataSetRead 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:
readWorkBookDatain 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:DataSetGet theNodeDatafor a specific ID.- Specified by:
getDataForIDin classDataSet- Parameters:
NodeID- The ID of theNodeDatarequested.- 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:DataSetSet the ID of this DataSet
-
getID
public int getID()
Description copied from class:DataSetGet the ID of this set.
-
getNodeIDs
public Set<String> getNodeIDs()
Description copied from class:DataSetGet the set of Node IDs contained in thisDataSet.- Specified by:
getNodeIDsin classDataSet- Returns:
- the set of node IDs in this
DataSet
-
getLayoutContainer
public DataContainer getLayoutContainer(DataSetLayoutProperties props) throws WrongDatasetTypeException
Description copied from class:DataSetGet a sample container for Layout purposes- Specified by:
getLayoutContainerin classDataSet- Parameters:
props- TheDataSetLayoutPropertiesfor which to get aDataContainer.- Returns:
- a sample container using Default data.
- Throws:
WrongDatasetTypeException- If the providedDataSetLayoutPropertiescannot be used with this Dataset
-
getDefaultData
public NodeData getDefaultData()
Description copied from class:DataSetGet a default NodeData object for this dataset- Specified by:
getDefaultDatain classDataSet- Returns:
- the Default Data used in this dataset.
-
getDataSetTypeName
public String getDataSetTypeName()
Description copied from class:DataSetGet the general Name for this Type of DataSet- Specified by:
getDataSetTypeNamein 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
Vectorof 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:
getHeadersin classDataSet- Returns:
- a Vector of all headers in this dataset.
-
reset
protected void reset()
Description copied from class:DataSetreset this Dataset to a stage as if it would have been just initialized.
-
getColorMapOptions
public Vector<ColorMap> getColorMapOptions()
Description copied from class:DataSetGet theColorMaps available for thisDataSetThe objects in this vector should always be the same (i.e. two successive calls should yield colormaps that can be compare with ==)- Specified by:
getColorMapOptionsin classDataSet- Returns:
- A collection of
ColorMaps available to thisDataSet
-
-