Package adams.data.weka
Class WekaLabelRange
- java.lang.Object
-
- adams.core.Range
-
- adams.core.AbstractDataBackedRange<weka.core.Attribute>
-
- adams.data.weka.WekaLabelRange
-
- All Implemented Interfaces:
adams.core.CloneHandler<adams.core.Range>
,adams.core.CustomDisplayStringProvider
,adams.core.ExampleProvider
,adams.core.HelpProvider
,Serializable
,Comparable<adams.core.Range>
public class WekaLabelRange extends adams.core.AbstractDataBackedRange<weka.core.Attribute>
ExtendedRange
class that also allows attribute names for specifying attribute positions (names are case-insensitive, just like placeholders for 'first', 'second', etc). If attribute names contain "-" or "," then they need to be surrounded by double-quotes.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WekaLabelRange()
Initializes with no range.WekaLabelRange(String range)
Initializes with the given range, but no maximum.WekaLabelRange(String range, int max)
Initializes with the given range and maximum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WekaLabelRange
getClone()
Returns a clone of the object.String
getExample()
Returns the example.protected String
getName(weka.core.Attribute data, int colIndex)
Returns the column name at the specified index.protected int
getNumNames(weka.core.Attribute data)
Returns the number of columns the dataset has.-
Methods inherited from class adams.core.AbstractDataBackedRange
canReplaceInvalidChars, escapeName, getData, getIndices, getIndices, getIntIndices, getIntSegments, getNames, initialize, initLookUp, isInRange, isName, parse, reset, setData, splitList, splitRange, unescapeName
-
Methods inherited from class adams.core.Range
clean, compareTo, equals, getActualRange, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getIntIndices, getIntSegments, getMax, getRange, getSubRanges, hashCode, hasRange, isAllRange, isEmpty, isInRange, isInverted, isPlaceholder, isValid, parse, parse, parsePlaceholder, setIndices, setIndices, setInverted, setMax, setRange, toDisplay, toExplicitRange, toRange, toString
-
-
-
-
Constructor Detail
-
WekaLabelRange
public WekaLabelRange()
Initializes with no range.
-
WekaLabelRange
public WekaLabelRange(String range)
Initializes with the given range, but no maximum.- Parameters:
range
- the range to use
-
WekaLabelRange
public WekaLabelRange(String range, int max)
Initializes with the given range and maximum.- Parameters:
range
- the range 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 WekaLabelRange getClone()
Returns a clone of the object.- Specified by:
getClone
in interfaceadams.core.CloneHandler<adams.core.Range>
- Overrides:
getClone
in classadams.core.AbstractDataBackedRange<weka.core.Attribute>
- Returns:
- the clone
-
getNumNames
protected int getNumNames(weka.core.Attribute data)
Returns the number of columns the dataset has.- Specified by:
getNumNames
in classadams.core.AbstractDataBackedRange<weka.core.Attribute>
- Parameters:
data
- the dataset to retrieve the number of columns
-
getName
protected String getName(weka.core.Attribute data, int colIndex)
Returns the column name at the specified index.- Specified by:
getName
in classadams.core.AbstractDataBackedRange<weka.core.Attribute>
- Parameters:
data
- the dataset to usecolIndex
- the column index- Returns:
- the column name
-
getExample
public String getExample()
Returns the example.- Specified by:
getExample
in interfaceadams.core.ExampleProvider
- Overrides:
getExample
in classadams.core.Range
- Returns:
- the example
-
-