weka.associations

## Class NumericItem

- java.lang.Object
- - weka.associations.Item
  - - weka.associations.NumericItem

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Item>

      public class NumericItem
      extends Item
      implements java.io.Serializable

  Class that encapsulates a numeric item.
  Version:
    $Revision: 10172 $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NumericItem.Comparison`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NumericItem(Attribute att, double splitPoint, NumericItem.Comparison comp)` Constructs a new `NumericItem`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object compareTo)` Equals.
    `NumericItem.Comparison` | `getComparison()` Gets the comparison operator for this item.
    `java.lang.String` | `getComparisonAsString()` Get this item's comparison operator as a String.
    `java.lang.String` | `getItemValueAsString()` Get this item's value as a String.
    `double` | `getSplitPoint()` Gets the numeric test.
    `java.lang.String` | `toString(boolean freq)` A string representation of this item, (i.e.

    - ### Methods inherited from class weka.associations.Item

      `compareTo, decreaseFrequency, decreaseFrequency, getAttribute, getFrequency, hashCode, increaseFrequency, increaseFrequency, toString`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NumericItem

          public NumericItem(Attribute att,
                     double splitPoint,
                     NumericItem.Comparison comp)
                      throws java.lang.Exception

      Constructs a new `NumericItem`
      Parameters:
        `att` - the attribute that backs the item.
        `splitPoint` - the numeric test value.
        `comp` - the comparison operator.
      Throws:
        `java.lang.Exception` - if the NumericItem can't be constructed.

  - ### Method Detail

    - #### getSplitPoint

          public double getSplitPoint()

      Gets the numeric test.
      Returns:
        the numeric test value for this item.

    - #### getComparison

          public NumericItem.Comparison getComparison()

      Gets the comparison operator for this item.
      Returns:
        the comparison operator for this item.

    - #### getItemValueAsString

          public java.lang.String getItemValueAsString()

      Get this item's value as a String.
      Specified by:
        `getItemValueAsString` in class `Item`
      Returns:
        this item's value as a String.

    - #### getComparisonAsString

          public java.lang.String getComparisonAsString()

      Get this item's comparison operator as a String.
      Specified by:
        `getComparisonAsString` in class `Item`
      Returns:
        this item's comparison operator as a String.

    - #### toString

          public java.lang.String toString(boolean freq)

      A string representation of this item, (i.e. ). This default implementation just prints the attribute name and (optionally) frequency information.
      Overrides:
        `toString` in class `Item`
      Parameters:
        `freq` - true if the frequency should be included.
      Returns:
        a string representation of this item.

    - #### equals

          public boolean equals(java.lang.Object compareTo)

      Equals. Compares the attribute, numeric test and comparison operator
      Overrides:
        `equals` in class `Item`
      Returns:
        true if this NumericItem is equal to the argument.