|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwpi.associations.arminerSequence.HashTree
A special data structure that is used to index a Vector of ARMinerItemset objects for more efficient processing.
Nested Class Summary | |
private class |
HashTree.HashNode
|
private static class |
HashTree.HashTreeOverflowException
|
private class |
HashTree.ListNode
|
private static class |
HashTree.MyHashtable
|
private static class |
HashTree.Node
|
Field Summary | |
private int |
counter
used for some computations |
private static int |
DEFAULT_HASH_SIZE
|
private static int |
DEFAULT_LIST_SIZE
|
private static int |
HASH_NODE
|
private int |
HASH_SIZE
|
private java.util.Vector |
itemsets
from the getCandidate method: |
private java.util.Vector |
leaves
keeps all leaves of the HashTree |
private static int |
LIST_NODE
|
private int |
LIST_SIZE
|
private HashTree.Node |
theRoot
the root of the HashTree |
Constructor Summary | |
HashTree(int listSize,
int hashSize,
java.util.Vector itemsets)
Create a new HashTree. |
|
HashTree(java.util.Vector itemsets)
Create a new HashTree. |
Method Summary | |
private HashTree.Node |
add(HashTree.Node node,
int level,
int index)
Adds a node recursively. |
void |
add(int index)
This method indexes in the HashTree the ARMinerItemset at index index from Vector itemsets which
was passed to the constructor of this HashTree. |
long |
countSubsets(ARMinerItemset itemset)
Count how many ARMinerItemsets are included in itemset |
private void |
countSubsets(HashTree.Node node,
ARMinerItemset itemset,
int index)
Count how many ARMinerItemsets are included in itemset recursively. |
private void |
prepare(HashTree.Node node)
Prepares the hash tree for desecent recursively. |
void |
prepareForDescent()
This method should be called before calling update() to gather all leaves of the HashTree for more efficient processing. |
private void |
readdAll()
Reset HashTree and readd all itemsets added previously this method may be called by add() |
private void |
unvisitLeaves()
Sets each leaf to unvisited. |
void |
update(ARMinerItemset row)
Update the weights of all indexed ARMinerItemsets that are included in row |
private void |
update(HashTree.Node node,
ARMinerItemset row,
int index)
Updates the support of itemsets recursively. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int LIST_NODE
private static final int HASH_NODE
private static final int DEFAULT_LIST_SIZE
private static final int DEFAULT_HASH_SIZE
private int LIST_SIZE
private int HASH_SIZE
private int counter
private java.util.Vector leaves
private java.util.Vector itemsets
private HashTree.Node theRoot
Constructor Detail |
public HashTree(int listSize, int hashSize, java.util.Vector itemsets)
listSize
parameter determines
after how many inserts in a ListNode we have to change it to a
HashNode (i.e. perform a split). The hashSize
parameter
can be specified to improve the efficiency of the structure.
listSize
- the size of the internal lists in the list nodeshashSize
- the size of the internal hashtables in the hash nodesitemsets
- the Vector of ARMinerItemsets that we should index
java.lang.IllegalArgumentException
- itemsets
is null
or listSize <= 0
or hashSize <= 0
public HashTree(java.util.Vector itemsets)
itemsets
- the Vector of ARMinerItemsets that we should index
java.lang.IllegalArgumentException
- itemsets
is nullMethod Detail |
private void unvisitLeaves()
public void prepareForDescent()
private void prepare(HashTree.Node node)
private void readdAll()
public void add(int index)
index
from Vector itemsets
which
was passed to the constructor of this HashTree.
index
- the index of the ARMinerItemset that we need to index in
this HashTree.private HashTree.Node add(HashTree.Node node, int level, int index)
node
- level
- index
- public void update(ARMinerItemset row)
row
row
- the ARMinerItemset (normally a database row) against
which we test for inclusionprivate void update(HashTree.Node node, ARMinerItemset row, int index)
node
- row
- the ARMinerItemset (normally a database row) against
which we test for inclusionindex
- public long countSubsets(ARMinerItemset itemset)
itemset
itemset
- the ARMinerItemset for which we count the subsetsprivate void countSubsets(HashTree.Node node, ARMinerItemset itemset, int index)
itemset
recursively.
node
- itemset
- the ARMinerItemset for which we count the subsetsindex
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |