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>colormapsprotected intcolumncountprotected Vector<String>columnLabelsA Vector indicating the labels of each columnprotected HashMap<String,ArrayNodeData>Datastatic StringDataSetTypestatic StringDEFAULT_SERIES_NAMEprotected ArrayNodeDatadefaultEntryprotected boolean[]emptycolumnsprotected 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 voiddetermineNonEmptyColumns(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()StringgetColumnLabel(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.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 (Description/Colorscale etc) for this dataset.Vector<Comparable>getHeaders()Get the Headers in this DataSetintgetID()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.booleanisColumnSet(int column)Check whether a specific column is set or empty.voidpreProcessWorkBook(IDAREWorkbook WB)Do preprocessing for the setup Process.voidreadWorkBookData(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 DataSetvoidsetTwoColumnHeaders(boolean twocols)Define what type of headers are being used.StringwriteDataSet()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 theArrayDataSetuseTwoCols- 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:DataSetDo preprocessing for the setup Process. This function is called before the actual data setup.- Overrides:
preProcessWorkBookin 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:DataSetreset 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: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.
-
setTwoColumnHeaders
public void setTwoColumnHeaders(boolean twocols)
Description copied from class:DataSetDefine what type of headers are being used.- Overrides:
setTwoColumnHeadersin classDataSet- Parameters:
twocols- whether to use two column headers when parsing
-
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
-
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:DataSetGet a default NodeData object for this dataset- Specified by:
getDefaultDatain classDataSet- Returns:
- the Default Data used in this dataset.
-
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
-
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
-
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)
-
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
-
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:DataSetGet the Headers in this DataSet- Specified by:
getHeadersin 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- TheIDAREWorkbookto determine empty columns from.
-
-