Package adams.data.weka
Class WekaAttributeIndex
- java.lang.Object
-
- adams.core.Index
-
- adams.core.AbstractDataBackedIndex<weka.core.Instances>
-
- adams.data.weka.WekaAttributeIndex
-
- All Implemented Interfaces:
CloneHandler<Index>,CustomDisplayStringProvider,ExampleProvider,HelpProvider,Serializable,Comparable<Index>
public class WekaAttributeIndex extends AbstractDataBackedIndex<weka.core.Instances>
ExtendedIndexclass that can use an attribute name to determine an index of a attribute as well.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WekaAttributeIndex()Initializes with no index.WekaAttributeIndex(String index)Initializes with the given index, but no maximum.WekaAttributeIndex(String index, int max)Initializes with the given index and maximum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WekaAttributeIndexgetClone()Returns a clone of the object.StringgetExample()Returns the example.protected StringgetName(weka.core.Instances data, int colIndex)Returns the column name at the specified index.protected intgetNumNames(weka.core.Instances data)Returns the number of columns the dataset has.-
Methods inherited from class adams.core.AbstractDataBackedIndex
clean, getData, getIndices, getIntIndex, getNames, initialize, isName, parse, replaceName, setData
-
Methods inherited from class adams.core.Index
compareTo, equals, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getIndex, getIntIndex, getMax, hashCode, hasIndex, isEmpty, isPlaceholder, parsePlaceholder, reset, setIndex, setMax, toDisplay, toString
-
-
-
-
Constructor Detail
-
WekaAttributeIndex
public WekaAttributeIndex()
Initializes with no index.
-
WekaAttributeIndex
public WekaAttributeIndex(String index)
Initializes with the given index, but no maximum.- Parameters:
index- the index to use
-
WekaAttributeIndex
public WekaAttributeIndex(String index, int max)
Initializes with the given index and maximum.- Parameters:
index- the index to usemax- the maximum of the 1-based index (e.g., use "10" to allow "1-10" or -1 for uninitialized)
-
-
Method Detail
-
getClone
public WekaAttributeIndex getClone()
Returns a clone of the object.- Specified by:
getClonein interfaceCloneHandler<Index>- Overrides:
getClonein classAbstractDataBackedIndex<weka.core.Instances>- Returns:
- the clone
-
getNumNames
protected int getNumNames(weka.core.Instances data)
Returns the number of columns the dataset has.- Specified by:
getNumNamesin classAbstractDataBackedIndex<weka.core.Instances>- Parameters:
data- the dataset to retrieve the number of columns
-
getName
protected String getName(weka.core.Instances data, int colIndex)
Returns the column name at the specified index.- Specified by:
getNamein classAbstractDataBackedIndex<weka.core.Instances>- Parameters:
data- the dataset to usecolIndex- the column index- Returns:
- the column name
-
getExample
public String getExample()
Returns the example.- Specified by:
getExamplein interfaceExampleProvider- Overrides:
getExamplein classIndex- Returns:
- the example
-
-