tools.tree.trie
Class Trie

java.lang.Object
  extended by tools.tree.trie.Trie
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
TrieFeatureMap

public class Trie
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Nested Class Summary
 class Trie.IdManager
          The id manager assignes unique labels to the nodes in a GML file
 
Constructor Summary
Trie()
           
 
Method Summary
 Trie and(Trie trie2)
          creates a consensus trie which contains the maximum common subtree
 java.lang.Object clone()
          returns a clone of this trie
 double computePercentMatch(Trie trie2)
          computes the percent match of this trie onto the other tree
 double computeSimilarityMin(Trie tree2)
          returns the minmax similarity for a pair of tries
 int computeSimilaritySpectrum(Trie tree2)
          returns the spectrum similarity of two trees
 double computeSimilaritySpectrumWeighted(Trie tree2)
          returns the spectrum similarity of two trees
 double computeSimilarityTanimoto(Trie tree2)
          returns the Tanimoto similarity for this pair of tries
 java.lang.String getGMLString()
          returns a GML representation of this trie
 java.lang.String getGMLStringPPP()
          returns a GML representation of this trie
 int getNumberOfFeatures()
          returns the number of leaves
 TrieNode getRoot()
          returns the root of this trie
 int getTotalFeatureCount()
          returns the total number of features, taking the counts of the features into account
 int getTotalNodeCount()
          returns the number of all nodes in the trie
 java.lang.Float getWeight()
          returns the total weight of all features of this trie, returns null if no weights are set
 void init()
          refreshes the number of leaves, e.g. after a new insert operation refrehs the total number of feature counts
 void insertPattern(PatternContainer c)
          insert a pattern into the trie
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trie

public Trie()
Method Detail

and

public Trie and(Trie trie2)
creates a consensus trie which contains the maximum common subtree

Parameters:
trie2 -
Returns:

clone

public java.lang.Object clone()
returns a clone of this trie

Overrides:
clone in class java.lang.Object

computePercentMatch

public double computePercentMatch(Trie trie2)
computes the percent match of this trie onto the other tree

Parameters:
trie2 -
Returns:

computeSimilarityMin

public double computeSimilarityMin(Trie tree2)
returns the minmax similarity for a pair of tries

Parameters:
tree2 -
Returns:

computeSimilaritySpectrum

public int computeSimilaritySpectrum(Trie tree2)
returns the spectrum similarity of two trees

Parameters:
tree2 -
Returns:

computeSimilaritySpectrumWeighted

public double computeSimilaritySpectrumWeighted(Trie tree2)
returns the spectrum similarity of two trees

Parameters:
tree2 -
Returns:

computeSimilarityTanimoto

public double computeSimilarityTanimoto(Trie tree2)
returns the Tanimoto similarity for this pair of tries

Parameters:
tree2 -
Returns:

getGMLString

public java.lang.String getGMLString()
returns a GML representation of this trie

Returns:

getGMLStringPPP

public java.lang.String getGMLStringPPP()
returns a GML representation of this trie

Returns:

getNumberOfFeatures

public int getNumberOfFeatures()
returns the number of leaves

Returns:

getRoot

public TrieNode getRoot()
returns the root of this trie

Returns:

getTotalFeatureCount

public int getTotalFeatureCount()
returns the total number of features, taking the counts of the features into account

Returns:

getTotalNodeCount

public int getTotalNodeCount()
returns the number of all nodes in the trie

Returns:

getWeight

public java.lang.Float getWeight()
returns the total weight of all features of this trie, returns null if no weights are set

Returns:

init

public void init()
refreshes the number of leaves, e.g. after a new insert operation refrehs the total number of feature counts


insertPattern

public void insertPattern(PatternContainer c)
insert a pattern into the trie

Parameters:
c -