Package adams.gui.visualization.instance
Class InstanceComparePanel.DatasetIndexer
- java.lang.Object
-
- adams.gui.visualization.instance.InstanceComparePanel.DatasetIndexer
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- InstanceComparePanel
public static class InstanceComparePanel.DatasetIndexer extends Object implements Serializable
Helper class for indexing the rows of a dataset.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Index
m_AttributeIndex
the attribute to index.protected weka.core.Instances
m_Dataset
the underlying dataset.protected TreeMap<String,Integer>
m_Index
the index.protected Boolean
m_IsString
whether the attribute is numeric or string/nominal.protected Range
m_Range
the range of attributes to use.protected weka.filters.unsupervised.attribute.Remove
m_Remove
the remove filter for trimming the range of attributes to return.static int
MAX_DECIMAL
the maximum number of decimals after the decimal point to use.
-
Constructor Summary
Constructors Constructor Description DatasetIndexer()
Initializes the indexer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAttributeIndex()
Returns the index of the attribute to use for indexing.weka.core.Instances
getDataset()
Returns the dataset to index.TreeMap<String,Integer>
getIndex()
Returns the index, generates it if necessary.String
getRange()
Returns the range of attributes to use.Instance
getRow(String row)
Returns the Instance for the row.List<String>
getRows()
Returns a list of row IDs.boolean
hasAttributeIndex()
Checks whether an attribute index has been set.protected void
initialize()
Initializes the indexer, if necessary.boolean
isString()
Returns whether the sort index is nominal/string or numeric.protected void
reset()
Invalidates the indexer.void
setAttributeIndex(String value)
Sets the index of the attribute to use for indexing.void
setDataset(weka.core.Instances value)
Sets the dataset to index.void
setRange(String value)
Sets the range of attributes to use.
-
-
-
Field Detail
-
MAX_DECIMAL
public static final int MAX_DECIMAL
the maximum number of decimals after the decimal point to use.- See Also:
- Constant Field Values
-
m_Dataset
protected weka.core.Instances m_Dataset
the underlying dataset.
-
m_AttributeIndex
protected Index m_AttributeIndex
the attribute to index.
-
m_Range
protected Range m_Range
the range of attributes to use.
-
m_IsString
protected Boolean m_IsString
whether the attribute is numeric or string/nominal.
-
m_Remove
protected weka.filters.unsupervised.attribute.Remove m_Remove
the remove filter for trimming the range of attributes to return.
-
-
Method Detail
-
reset
protected void reset()
Invalidates the indexer.
-
setDataset
public void setDataset(weka.core.Instances value)
Sets the dataset to index.- Parameters:
value
- the dataset
-
getDataset
public weka.core.Instances getDataset()
Returns the dataset to index.- Returns:
- the dataset
-
hasAttributeIndex
public boolean hasAttributeIndex()
Checks whether an attribute index has been set.- Returns:
- true if an attribute index has been set
-
setAttributeIndex
public void setAttributeIndex(String value)
Sets the index of the attribute to use for indexing.- Parameters:
value
- the index
-
getAttributeIndex
public String getAttributeIndex()
Returns the index of the attribute to use for indexing.- Returns:
- the index
-
setRange
public void setRange(String value)
Sets the range of attributes to use.- Parameters:
value
- the range
-
getRange
public String getRange()
Returns the range of attributes to use.- Returns:
- the range
-
initialize
protected void initialize()
Initializes the indexer, if necessary.
-
isString
public boolean isString()
Returns whether the sort index is nominal/string or numeric.- Returns:
- true if string/nominal
-
getIndex
public TreeMap<String,Integer> getIndex()
Returns the index, generates it if necessary.- Returns:
- the generated index
-
-