Package weka.associations
Class NumericItem
- java.lang.Object
-
- weka.associations.Item
-
- weka.associations.NumericItem
-
- All Implemented Interfaces:
Serializable,Comparable<Item>
public class NumericItem extends Item implements Serializable
Class that encapsulates a numeric item.- Version:
- $Revision$
- 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(Object compareTo)Equals.NumericItem.ComparisongetComparison()Gets the comparison operator for this item.StringgetComparisonAsString()Get this item's comparison operator as a String.StringgetItemValueAsString()Get this item's value as a String.doublegetSplitPoint()Gets the numeric test.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 Exception
Constructs a newNumericItem- Parameters:
att- the attribute that backs the item.splitPoint- the numeric test value.comp- the comparison operator.- Throws:
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 String getItemValueAsString()
Get this item's value as a String.- Specified by:
getItemValueAsStringin classItem- Returns:
- this item's value as a String.
-
getComparisonAsString
public 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 String toString(boolean freq)
A string representation of this item, (i.e.- ). This default implementation just prints the attribute name and (optionally) frequency information.
-
-