de.folt.fuzzy
Class StringFuzzyNode<T>

java.lang.Object
  extended by java.util.Observable
      extended by de.folt.fuzzy.FuzzyDataStructureElement<K,T>
          extended by de.folt.fuzzy.FuzzyNode<java.lang.String,T>
              extended by de.folt.fuzzy.StringFuzzyNode<T>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MonoLingualFuzzyNode, SQLMonoLingualFuzzyNode

public class StringFuzzyNode<T>
extends FuzzyNode<java.lang.String,T>

This class implements a FuzzyNode and uses a String as the reference value for the key. The fuzzy key is computed from the given string.

Author:
klemens
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.folt.fuzzy.FuzzyNode
FuzzyNode.FUZZYNODESTATUS
 
Constructor Summary
StringFuzzyNode()
           
StringFuzzyNode(java.lang.String string, T value)
           
StringFuzzyNode(java.lang.String string, T value, int iKeyLen)
           
 
Method Summary
 void remove(java.lang.Object value)
          remove remove for a fuzzy node based on the value of a node and removes this value from the value list.
 boolean removeValue(java.lang.Object value)
          removeValue removes a value from the value list of the values of the node
 java.util.Vector<FuzzyNodeSearchResult<java.lang.String,T>> search(FuzzyNode<java.lang.String,T> fuzzyCompareKey, int similarity)
          search searches FuzzyNode and its sons with a given similarity and returns a Vector of matching keys.
 java.util.Vector<FuzzyNode<java.lang.String,T>> search(java.lang.Object value)
          search search for a fuzzy node based on the value of a node
 java.util.Vector<FuzzyNodeSearchResult<java.lang.String,T>> search(java.lang.String string, int similarity)
           
 java.lang.String shortFormat()
          shortformat formats a FuzzyNode and returns a formatted string of the fuzzy node in a more compact way than format()
 
Methods inherited from class de.folt.fuzzy.FuzzyNode
computeKeyDistance, countNodes, countSons, countValues, format, formatTree, formatTree, getDepth, getFuzzyNodeKey, getLeftSon, getMaxID, getNGram, getNodeID, getNODESMATCHED, getNODESPUSHED, getNODESSEARCHED, getRightSon, getStatus, getValues, iBalance, insertFuzzyNode, insertFuzzyNode, isAVLTree, isBInsertMode, removeValue, removeValue, setBInsertmode, setFuzzyNodeKey, setLeftSon, setMaxID, setNodeID, setRightSon, setStatus, setValues, updateFuzzyNode
 
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

StringFuzzyNode

public StringFuzzyNode()

StringFuzzyNode

public StringFuzzyNode(java.lang.String string,
                       T value)
Parameters:
string - the string for the FuzzyNodeKey construction.
value - the value for the FuzzyNode

StringFuzzyNode

public StringFuzzyNode(java.lang.String string,
                       T value,
                       int iKeyLen)
Parameters:
string - the string for the FuzzyNodeKey construction
value - value the value for the FuzzyNode
iKeyLen - the key length for the FuzzyNodeKey
Method Detail

remove

public void remove(java.lang.Object value)
Description copied from class: FuzzyNode
remove remove for a fuzzy node based on the value of a node and removes this value from the value list. It searches thru all nodes to find the (Objec) value

Overrides:
remove in class FuzzyNode<java.lang.String,T>

removeValue

public boolean removeValue(java.lang.Object value)
Description copied from class: FuzzyNode
removeValue removes a value from the value list of the values of the node

Overrides:
removeValue in class FuzzyNode<java.lang.String,T>
Parameters:
value - the object to remove
Returns:
true when successfully removed, otherwise false

search

public java.util.Vector<FuzzyNodeSearchResult<java.lang.String,T>> search(FuzzyNode<java.lang.String,T> fuzzyCompareKey,
                                                                          int similarity)
Description copied from class: FuzzyNode
search searches FuzzyNode and its sons with a given similarity and returns a Vector of matching keys.

Overrides:
search in class FuzzyNode<java.lang.String,T>
Parameters:
fuzzyCompareKey - the node to search for in the current node and its sons
similarity - the similarity in % (100% = perfect match)
Returns:
a vector of FuzzyNodeSearchResult

search

public java.util.Vector<FuzzyNode<java.lang.String,T>> search(java.lang.Object value)
Description copied from class: FuzzyNode
search search for a fuzzy node based on the value of a node

Overrides:
search in class FuzzyNode<java.lang.String,T>
Returns:
return all the matching FuzzyNodes in a vector

search

public java.util.Vector<FuzzyNodeSearchResult<java.lang.String,T>> search(java.lang.String string,
                                                                          int similarity)

shortFormat

public java.lang.String shortFormat()
Description copied from class: FuzzyNode
shortformat formats a FuzzyNode and returns a formatted string of the fuzzy node in a more compact way than format()

Overrides:
shortFormat in class FuzzyNode<java.lang.String,T>
Returns:
formatted FuzzyNode