Class 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
    • 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 the ArrayDataSet
        useTwoCols - Whether to use individual columns for label and ID or use one column for both
        properties - properties of this ArrayDataSet
    • 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 class DataSet
        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.
        Overrides:
        reset in class DataSet
      • 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 class DataSet
        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 class DataSet
        Parameters:
        twocols - whether to use two column headers when parsing
      • getDataForID

        public NodeData getDataForID​(String NodeID)
        Description copied from class: DataSet
        Get the NodeData for a specific ID.
        Specified by:
        getDataForID in class DataSet
        Parameters:
        NodeID - The ID of the NodeData 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
        Specified by:
        setID in class DataSet
        Parameters:
        id - The ID assigned to this DataSet
      • getID

        public int getID()
        Description copied from class: DataSet
        Get the ID of this set.
        Specified by:
        getID in class DataSet
        Returns:
        the internal ID of 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 class DataSet
        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 class DataSet
        Returns:
        The Type of Dataset (as String)
      • getColorMapOptions

        public Vector<ColorMap> getColorMapOptions()
        Description copied from class: DataSet
        Get the ColorMaps available for this DataSet 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 class DataSet
        Returns:
        A collection of ColorMaps available to this DataSet
      • 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 class DataSet
        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 - The IDAREWorkbook to determine empty columns from.