wpi.associations.arminerSequence
Class SET

java.lang.Object
  extended bywpi.associations.arminerSequence.SET

public class SET
extends java.lang.Object

Implements a Set Enumeration Tree, which is a prefix tree used for storing and retrieving itemset information.

Author:
Dana Cristofor, Laurentiu Cristofor, Keith A. Pray (kap@wpi.edu)

Nested Class Summary
private  class SET.HashNode
           
 
Field Summary
private static int debug
          Specifies debug info level 0: no debug info 1: input to methods 2: and out from methods 3: and all sorts of stuff
private  int level
           
private  java.util.Hashtable numberHash
          Used to look up actual value of an item using its integer representation.
private  SET.HashNode root
           
 
Constructor Summary
SET()
          Create a new empty SET.
 
Method Summary
 long getEventWeight(ARMinerItemset itemset)
          Return the event weight for a given itemset.
 java.util.Vector getItemsets()
          Return the itemsets of the SET.
 java.util.Vector getMaximalItemsets()
          Return the maximal itemsets of the SET.
private  SET.HashNode getNode(ARMinerItemset itemset)
          Return the node for a given itemset.
 java.util.Hashtable getNumberHash()
          Returns the number hash used for looking up values in this itemset.
 float getSupport(ARMinerItemset itemset)
          Return the support for a given itemset.
 void insert(ARMinerItemset itemset)
          Insert a new itemset in the SET.
static void main(java.lang.String[] args)
          Main method for testing purposes.
 void setNumberHash(java.util.Hashtable h)
          Sets the number hash to use for looking up values in this itemset
 java.lang.String toString()
          Return a string representation of the SET.
private  void traverseGatherAll(SET.HashNode node, ARMinerItemset itemset, java.util.Vector vector)
          A private method which gets called recursively to retrieve itemsets from all the nodes of the SET.
private  void traverseGatherLeaves(SET.HashNode node, ARMinerItemset itemset, java.util.Vector vector)
          A private method which gets called recursively to retrieve itemsets from the leaf nodes of the SET.
private  void traversePrint(SET.HashNode node, java.lang.StringBuffer sb)
          A private method which gets called recursively to retrieve itemsets from each node of the SET and print them to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

root

private SET.HashNode root

level

private int level

numberHash

private java.util.Hashtable numberHash
Used to look up actual value of an item using its integer representation.


debug

private static final int debug
Specifies debug info level 0: no debug info 1: input to methods 2: and out from methods 3: and all sorts of stuff

See Also:
Constant Field Values
Constructor Detail

SET

public SET()
Create a new empty SET.

Method Detail

setNumberHash

public void setNumberHash(java.util.Hashtable h)
Sets the number hash to use for looking up values in this itemset

Parameters:
h - the number hash

getNumberHash

public java.util.Hashtable getNumberHash()
Returns the number hash used for looking up values in this itemset.

Returns:
the number hash

insert

public void insert(ARMinerItemset itemset)
Insert a new itemset in the SET.

Parameters:
itemset - the itemset to be inserted
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty

getSupport

public float getSupport(ARMinerItemset itemset)
                 throws SETException
Return the support for a given itemset.

Parameters:
itemset - the itemset for which we want to obtain the support
Returns:
support
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty
SETException - itemset not found in SET

getEventWeight

public long getEventWeight(ARMinerItemset itemset)
                    throws SETException
Return the event weight for a given itemset.

Parameters:
itemset - the itemset for which we want to obtain the event weight
Returns:
event weight
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty
SETException - itemset not found in SET

getNode

private SET.HashNode getNode(ARMinerItemset itemset)
                      throws SETException
Return the node for a given itemset.

Parameters:
itemset - the itemset for which we want to obtain the node
Returns:
the node representing the itemset
Throws:
java.lang.IllegalArgumentException - itemset is null or is empty
SETException - itemset not found in SET

getMaximalItemsets

public java.util.Vector getMaximalItemsets()
Return the maximal itemsets of the SET.

Returns:
a vector containing the maximal itemsets from the SET

getItemsets

public java.util.Vector getItemsets()
Return the itemsets of the SET.

Returns:
a vector containing the itemsets from the SET

traverseGatherLeaves

private void traverseGatherLeaves(SET.HashNode node,
                                  ARMinerItemset itemset,
                                  java.util.Vector vector)
A private method which gets called recursively to retrieve itemsets from the leaf nodes of the SET.

Parameters:
node - node starts from the root node of the SET.
itemset - for storing hashtable keys as it traverses node by node to the leaf.
vector - for storing itemsets .

traverseGatherAll

private void traverseGatherAll(SET.HashNode node,
                               ARMinerItemset itemset,
                               java.util.Vector vector)
A private method which gets called recursively to retrieve itemsets from all the nodes of the SET.

Parameters:
node - node starts from the root node of the SET.
itemset - for storing hashtable keys as it traverses node by node to the leaf.
vector - for storing itemsets .

traversePrint

private void traversePrint(SET.HashNode node,
                           java.lang.StringBuffer sb)
A private method which gets called recursively to retrieve itemsets from each node of the SET and print them to a String.

Parameters:
node - node to traverse

toString

public java.lang.String toString()
Return a string representation of the SET.

Returns:
string representation of SET

main

public static void main(java.lang.String[] args)
Main method for testing purposes.