weka.classifiers.rules
Class DecisionTable.hashKey

java.lang.Object
  extended byweka.classifiers.rules.DecisionTable.hashKey
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
DecisionTable

public class DecisionTable.hashKey
extends java.lang.Object
implements java.io.Serializable

Class providing keys to the hash table

See Also:
Serialized Form

Field Summary
private  double[] attributes
          Array of attribute values for an instance
private  int key
          The key
private  boolean[] missing
          True for an index if the corresponding attribute value is missing.
private  java.lang.String[] values
          The values
 
Constructor Summary
DecisionTable.hashKey(double[] t)
          Constructor for a hashKey
DecisionTable.hashKey(Instance t, int numAtts)
          Constructor for a hashKey
 
Method Summary
 boolean equals(java.lang.Object b)
          Tests if two instances are equal
 int hashCode()
          Calculates a hash code
 void print_hash_code()
          Prints the hash code
 java.lang.String toString(Instances t, int maxColWidth)
          Convert a hash entry to a string
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

private double[] attributes
Array of attribute values for an instance


missing

private boolean[] missing
True for an index if the corresponding attribute value is missing.


values

private java.lang.String[] values
The values


key

private int key
The key

Constructor Detail

DecisionTable.hashKey

public DecisionTable.hashKey(Instance t,
                             int numAtts)
                      throws java.lang.Exception
Constructor for a hashKey

Parameters:
t - an instance from which to generate a key
numAtts - the number of attributes

DecisionTable.hashKey

public DecisionTable.hashKey(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 instances
maxColWidth - width to make the fields

hashCode

public int hashCode()
Calculates a hash code

Returns:
the hash code as an integer

equals

public boolean equals(java.lang.Object b)
Tests if two instances are equal

Parameters:
b - a key to compare with

print_hash_code

public void print_hash_code()
Prints the hash code