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 adams.core.Indexm_AttributeIndexthe attribute to index.protected weka.core.Instancesm_Datasetthe underlying dataset.protected TreeMap<String,Integer>m_Indexthe index.protected Booleanm_IsStringwhether the attribute is numeric or string/nominal.protected adams.core.Rangem_Rangethe range of attributes to use.protected weka.filters.unsupervised.attribute.Removem_Removethe remove filter for trimming the range of attributes to return.static intMAX_DECIMALthe 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 StringgetAttributeIndex()Returns the index of the attribute to use for indexing.weka.core.InstancesgetDataset()Returns the dataset to index.TreeMap<String,Integer>getIndex()Returns the index, generates it if necessary.StringgetRange()Returns the range of attributes to use.InstancegetRow(String row)Returns the Instance for the row.List<String>getRows()Returns a list of row IDs.booleanhasAttributeIndex()Checks whether an attribute index has been set.protected voidinitialize()Initializes the indexer, if necessary.booleanisString()Returns whether the sort index is nominal/string or numeric.protected voidreset()Invalidates the indexer.voidsetAttributeIndex(String value)Sets the index of the attribute to use for indexing.voidsetDataset(weka.core.Instances value)Sets the dataset to index.voidsetRange(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 adams.core.Index m_AttributeIndex
the attribute to index.
-
m_Range
protected adams.core.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
-
-