Class WekaUnorderedAttributeRange

  • All Implemented Interfaces:
    adams.core.CloneHandler<adams.core.UnorderedRange>, adams.core.CustomDisplayStringProvider, adams.core.ExampleProvider, adams.core.HelpProvider, Serializable, Comparable<adams.core.UnorderedRange>

    public class WekaUnorderedAttributeRange
    extends adams.core.AbstractDataBackedUnorderedRange<weka.core.Instances>
    Extended UnorderedRange 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.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.core.AbstractDataBackedUnorderedRange

        adams.core.AbstractDataBackedUnorderedRange.InvertedStringLengthComparator
    • Field Summary

      • Fields inherited from class adams.core.AbstractDataBackedUnorderedRange

        m_Data
      • Fields inherited from class adams.core.UnorderedRange

        ALL, FIRST, LAST, LAST_1, LAST_2, m_Indices, m_Max, m_Raw, RANGE, SECOND, SEPARATOR, THIRD
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WekaUnorderedAttributeRange getClone()
      Returns a clone of the object.
      String getExample()
      Returns the example.
      protected String getName​(weka.core.Instances data, int colIndex)
      Returns the column name at the specified index.
      protected int getNumNames​(weka.core.Instances data)
      Returns the number of columns the dataset has.
      protected int[] parseSubRange​(String subrange)
      Parses the subrange.
      • Methods inherited from class adams.core.AbstractDataBackedUnorderedRange

        getData, getIntIndices, initialize, isInRange, setData
      • Methods inherited from class adams.core.UnorderedRange

        compareTo, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getIntIndices, getMax, getRange, hasRange, isAllRange, isEmpty, isInRange, isValid, parse, reset, setIndices, setIndices, setMax, setRange, splitRange, toDisplay, toExplicitRange, toRange, toString
    • Constructor Detail

      • WekaUnorderedAttributeRange

        public WekaUnorderedAttributeRange()
        Initializes with no range.
      • WekaUnorderedAttributeRange

        public WekaUnorderedAttributeRange​(String range)
        Initializes with the given range, but no maximum.
        Parameters:
        range - the range to use
      • WekaUnorderedAttributeRange

        public WekaUnorderedAttributeRange​(String range,
                                           int max)
        Initializes with the given range and maximum.
        Parameters:
        range - the range to use
        max - the maximum of the 1-based index (e.g., use "10" to allow "1-10" or -1 for uninitialized)
    • Method Detail

      • getClone

        public WekaUnorderedAttributeRange getClone()
        Returns a clone of the object.
        Specified by:
        getClone in interface adams.core.CloneHandler<adams.core.UnorderedRange>
        Overrides:
        getClone in class adams.core.AbstractDataBackedUnorderedRange<weka.core.Instances>
        Returns:
        the clone
      • getNumNames

        protected int getNumNames​(weka.core.Instances data)
        Returns the number of columns the dataset has.
        Specified by:
        getNumNames in class adams.core.AbstractDataBackedUnorderedRange<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:
        getName in class adams.core.AbstractDataBackedUnorderedRange<weka.core.Instances>
        Parameters:
        data - the dataset to use
        colIndex - the column index
        Returns:
        the column name
      • parseSubRange

        protected int[] parseSubRange​(String subrange)
        Parses the subrange.
        Overrides:
        parseSubRange in class adams.core.UnorderedRange
        Parameters:
        subrange - the subrange
        Returns:
        the indices
      • getExample

        public String getExample()
        Returns the example.
        Specified by:
        getExample in interface adams.core.ExampleProvider
        Overrides:
        getExample in class adams.core.UnorderedRange
        Returns:
        the example