de.folt.fuzzy
Class SQLMonoLingualPartitionedFuzzyNodeTree

java.lang.Object
  extended by java.util.Observable
      extended by de.folt.fuzzy.SQLMonoLingualPartitionedFuzzyNodeTree
All Implemented Interfaces:
java.io.Serializable

public class SQLMonoLingualPartitionedFuzzyNodeTree
extends java.util.Observable
implements java.io.Serializable

This class extends the class StringFuzzyNodeTree by adding an additional layer to the structure of the underlying tree.
For each language resulting from a MonoLingualObject a separate StringFuzzyTree is generated and stored in a ObservableHashtable.

  Structure:
  [de] [en] [fr]           ....        [es] .... [it] (a hash table)
   |                                     |
   |                                    references the corresponding StringFuzzyTree for language es   
   |                          
   references the corresponding StringFuzzyTreefor language de 
   | (this references the StringFuzzyTree level)
  [0] [1] [2]           ....        [i] .... [n] (a hash table)
   |                                 |
   references the root fuzzy node    references the root fuzzy node 
   with key sum 0                    with key sum i
  
  

Author:
klemens
See Also:
Serialized Form

Constructor Summary
SQLMonoLingualPartitionedFuzzyNodeTree()
           
 
Method Summary
 int countNodes()
          countNodes count all the nodes in the tree
 java.lang.String format()
          format return a formated partitioned fuzzy tree based on the fuzzy nodes
 StringPartitionedFuzzyNodeTree<SQLMonoLingualObject> getFuzzyNodeTree(java.lang.String language)
          getRoot returns a specific fuzzy Node tree
 int getIMaxIndex()
           
 java.util.Hashtable<java.lang.String,StringPartitionedFuzzyNodeTree<SQLMonoLingualObject>> getLanguageNodeTrees()
           
 int getNODESMATCHED()
           
 int getNODESPUSHED()
           
 int getNODESSEARCHED()
           
 boolean insertFuzzyNode(SQLMonoLingualFuzzyNode fuzzyNodeToAdd)
          insertFuzzyNode inserts a Fuzzy node into a partitioned fuzzy node tree;
 boolean remove(SQLMonoLingualObject sqlmono)
          remove removes a SQLMonoLingualObject based on it stUniqueId
 boolean removeValue(SQLMonoLingualFuzzyNode fuzzyCompareKey)
          removeValue removes a value from the value list of the values of the node based on a key.
 java.util.Vector<FuzzyNodeSearchResult<java.lang.String,SQLMonoLingualObject>> search(SQLMonoLingualFuzzyNode fuzzyCompareKey, int similarity)
          search returns all a FuzzyNodeSearchResult of all matching FuzzyNodes
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLMonoLingualPartitionedFuzzyNodeTree

public SQLMonoLingualPartitionedFuzzyNodeTree()
Method Detail

countNodes

public int countNodes()
countNodes count all the nodes in the tree

Returns:
the nodes in the tree

format

public java.lang.String format()
format return a formated partitioned fuzzy tree based on the fuzzy nodes

Returns:
formatted partitioned fuzzy tree as string

getFuzzyNodeTree

public StringPartitionedFuzzyNodeTree<SQLMonoLingualObject> getFuzzyNodeTree(java.lang.String language)
getRoot returns a specific fuzzy Node tree

Parameters:
language - the language of the partitioned FuzzyTree to return
Returns:
the language partitioned fuzzy node tree corresponding to the KEYSUM of the fuzzy node of this tree

getIMaxIndex

public int getIMaxIndex()
Returns:
the iMaxIndex -highest KEYSUm currently in the partitioned Fuzzy Node Tree

getLanguageNodeTrees

public java.util.Hashtable<java.lang.String,StringPartitionedFuzzyNodeTree<SQLMonoLingualObject>> getLanguageNodeTrees()
Returns:
the languageNodeTrees

getNODESMATCHED

public int getNODESMATCHED()
Returns:
the nODESMATCHED

getNODESPUSHED

public int getNODESPUSHED()
Returns:
the nODESPUSHED

getNODESSEARCHED

public int getNODESSEARCHED()
Returns:
the nODESSEARCHED

insertFuzzyNode

public boolean insertFuzzyNode(SQLMonoLingualFuzzyNode fuzzyNodeToAdd)
insertFuzzyNode inserts a Fuzzy node into a partitioned fuzzy node tree;

Parameters:
fuzzyNodeToAdd - fuzzy node to insert
Returns:
true for success, false for failure

remove

public boolean remove(SQLMonoLingualObject sqlmono)
remove removes a SQLMonoLingualObject based on it stUniqueId

Parameters:
sqlmono -
Returns:
true when successfully removed, otherwise false

removeValue

public boolean removeValue(SQLMonoLingualFuzzyNode fuzzyCompareKey)
removeValue removes a value from the value list of the values of the node based on a key. The values of the key are the objects to remove from the list

Parameters:
fuzzyCompareKey - the key containing the value to remove
Returns:
true when successfully removed, otherwise false

search

public java.util.Vector<FuzzyNodeSearchResult<java.lang.String,SQLMonoLingualObject>> search(SQLMonoLingualFuzzyNode fuzzyCompareKey,
                                                                                             int similarity)
search returns all a FuzzyNodeSearchResult of all matching FuzzyNodes

Parameters:
fuzzyCompareKey - the fuzzy node to search for with similarity
similarity - the similarity to search for
Returns:
a vector of FuzzyNodeSearchResult