de.folt.fuzzy
Class FuzzyDataStructure<K,T,S>

java.lang.Object
  extended by java.util.Observable
      extended by de.folt.fuzzy.FuzzyDataStructure<K,T,S>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FuzzyNodeTree, FuzzyStringHashtable

public abstract class FuzzyDataStructure<K,T,S>
extends java.util.Observable
implements java.io.Serializable

This class defines the (abstract) method for a general fuzzy data structure, a class which is intended to support fuzzy = similarity search.
It is created three types:
K represent a key structure
T represents a value object
S represents a Search Result (result of class SearchResult)
Examples are:
FuzzyNodeTree extends FuzzyDataStructure> implements Serializable

Author:
klemens
See Also:
Serialized Form

Constructor Summary
FuzzyDataStructure()
           
 
Method Summary
abstract  int countNodes()
          countNodes count all the nodes in the tree (includes the root node!)
abstract  java.lang.String format()
          format return a formated fuzzy tree based on the fuzzy nodes
abstract  int getNODESMATCHED()
           
abstract  int getNODESPUSHED()
           
abstract  int getNODESSEARCHED()
           
abstract  FuzzyDataStructureElement<K,T> getRoot()
           
abstract  boolean insertFuzzyNode(FuzzyDataStructureElement<K,T> fuzzyNodeToAdd)
          insertFuzzyNode inserts a Fuzzy node into the tree; if called for the first time the root is set to the fuzzyNodeToAdd
abstract  java.util.Vector<S> search(FuzzyDataStructureElement<K,T> fuzzyCompareKey, int similarity)
          search searches for FuzzyNodes matching similarity
abstract  void setNODESMATCHED(int nodesmatched)
           
abstract  void setNODESPUSHED(int nodespushed)
           
abstract  void setNODESSEARCHED(int nodessearched)
           
 
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

FuzzyDataStructure

public FuzzyDataStructure()
Method Detail

countNodes

public abstract int countNodes()
countNodes count all the nodes in the tree (includes the root node!)

Returns:
the nodes in the tree

format

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

Returns:
formatted fuzzy tree as string

getNODESMATCHED

public abstract int getNODESMATCHED()
Returns:
the nODESMATCHED

getNODESPUSHED

public abstract int getNODESPUSHED()
Returns:
the nODESPUSHED

getNODESSEARCHED

public abstract int getNODESSEARCHED()
Returns:
the nODESSEARCHED

getRoot

public abstract FuzzyDataStructureElement<K,T> getRoot()
Returns:
the root - the root node of the Fuzzy Tree

insertFuzzyNode

public abstract boolean insertFuzzyNode(FuzzyDataStructureElement<K,T> fuzzyNodeToAdd)
insertFuzzyNode inserts a Fuzzy node into the tree; if called for the first time the root is set to the fuzzyNodeToAdd

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

search

public abstract java.util.Vector<S> search(FuzzyDataStructureElement<K,T> fuzzyCompareKey,
                                           int similarity)
search searches for FuzzyNodes matching similarity

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

setNODESMATCHED

public abstract void setNODESMATCHED(int nodesmatched)
Parameters:
nodesmatched - the nODESMATCHED to set

setNODESPUSHED

public abstract void setNODESPUSHED(int nodespushed)
Parameters:
nodespushed - the nODESPUSHED to set

setNODESSEARCHED

public abstract void setNODESSEARCHED(int nodessearched)
Parameters:
nodessearched - the nODESSEARCHED to set