Package 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 Description static classNumericItem.Comparison
-
Constructor Summary
Constructors Constructor Description NumericItem(Attribute att, double splitPoint, NumericItem.Comparison comp)Constructs a newNumericItem
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object compareTo)Equals.NumericItem.ComparisongetComparison()Gets the comparison operator for this item.java.lang.StringgetComparisonAsString()Get this item's comparison operator as a String.java.lang.StringgetItemValueAsString()Get this item's value as a String.doublegetSplitPoint()Gets the numeric test.java.lang.StringtoString(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
-
-
-
-
Constructor Detail
-
NumericItem
public NumericItem(Attribute att, double splitPoint, NumericItem.Comparison comp) throws java.lang.Exception
Constructs a newNumericItem- 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:
getItemValueAsStringin classItem- 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:
getComparisonAsStringin classItem- 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.
-
-