Package weka.classifiers.rules
Class DecisionTableHashKey
- java.lang.Object
-
- weka.classifiers.rules.DecisionTableHashKey
-
- All Implemented Interfaces:
java.io.Serializable
,RevisionHandler
public class DecisionTableHashKey extends java.lang.Object implements java.io.Serializable, RevisionHandler
Class providing hash table keys for DecisionTable- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DecisionTableHashKey(double[] t)
Constructor for a hashKeyDecisionTableHashKey(Instance t, int numAtts, boolean ignoreClass)
Constructor for a hashKey
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object b)
Tests if two instances are equaljava.lang.String
getRevision()
Returns the revision string.int
hashCode()
Calculates a hash codevoid
print_hash_code()
Prints the hash codejava.lang.String
toString(Instances t, int maxColWidth)
Convert a hash entry to a string
-
-
-
Constructor Detail
-
DecisionTableHashKey
public DecisionTableHashKey(Instance t, int numAtts, boolean ignoreClass) throws java.lang.Exception
Constructor for a hashKey- Parameters:
t
- an instance from which to generate a keynumAtts
- the number of attributesignoreClass
- if true treat the class as a normal attribute- Throws:
java.lang.Exception
- if something goes wrong
-
DecisionTableHashKey
public DecisionTableHashKey(double[] t)
Constructor for a hashKey- Parameters:
t
- an array of feature values
-
-
Method Detail
-
toString
public java.lang.String toString(Instances t, int maxColWidth)
Convert a hash entry to a string- Parameters:
t
- the set of instancesmaxColWidth
- width to make the fields- Returns:
- string representation of the hash entry
-
hashCode
public int hashCode()
Calculates a hash code- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code as an integer
-
equals
public boolean equals(java.lang.Object b)
Tests if two instances are equal- Overrides:
equals
in classjava.lang.Object
- Parameters:
b
- a key to compare with- Returns:
- true if both objects are equal
-
print_hash_code
public void print_hash_code()
Prints the hash code
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
-