de.folt.fuzzy
Class FuzzyNodeSearchResult<K,T>

java.lang.Object
  extended by de.folt.fuzzy.SearchResult<K,T>
      extended by de.folt.fuzzy.FuzzyNodeSearchResult<K,T>

public class FuzzyNodeSearchResult<K,T>
extends SearchResult<K,T>

This class represents the result of a fuzzy node search. It contains the reference to the fuzzy node which fulfilled the search criteria. distance is difference between the node found and the node searched. kleyDistance is the value computed based on the search similarity in % supplied; it represents the absolute key value of the similarity. If a string was search levenDistance contains the Levenshtein distance. This is actually an array of float numbers for each of the values of the fuzzy node. In addition it contains some statistical information: NODESMATCHED is the number of matching nodes, NOEDESSEACHED the number of nodes searched in the tree so far and NODESPUSHED the number of fuzzy nodes pushed onto the stack so far. SearchSimilarity is the similarity value which was used for the fuzzy search algorithm.

Author:
klemens

Constructor Summary
FuzzyNodeSearchResult(float distance, FuzzyNode<K,T> fuzzyNode)
          Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node
FuzzyNodeSearchResult(float distance, FuzzyNode<K,T> fuzzyNode, int nodessearched, int nodesmatched, int nodespushed)
          Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node
FuzzyNodeSearchResult(float distance, int similarity, float dist, int difference, FuzzyNode<K,T> fuzzyNode, int nodessearched, int nodesmatched, int nodespushed)
          Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node
 
Method Summary
 java.lang.String format()
          format formats a FuzzyNodeResult
 float getDistance()
           
 FuzzyNode<K,T> getFuzzyNode()
           
 int getFuzzyNodedifference()
           
 float getKeyDistance()
           
 float[] getLevenDistance()
          return the Levenshtein distances computed.
 int getNODESMATCHED()
           
 int getNODESPUSHED()
           
 int getNODESSEARCHED()
           
 int getSearchSimilarity()
           
 void setDistance(float distance)
           
 void setFuzzyNode(FuzzyNode<K,T> fuzzyNode)
           
 void setFuzzyNodedifference(int fuzzyNodedifference)
           
 void setKeyDistance(float keyDistance)
           
 void setLevenDistance(float[] levenDistance)
          Sets the levenDistance of the result for each of the values of the result node.
 void setNODESMATCHED(int nodesmatched)
           
 void setNODESPUSHED(int nodespushed)
           
 void setNODESSEARCHED(int nodessearched)
           
 void setSearchSimilarity(int searchSimilarity)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuzzyNodeSearchResult

public FuzzyNodeSearchResult(float distance,
                             FuzzyNode<K,T> fuzzyNode)
Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node

Parameters:
distance - the distance for the fuzzy node keys
fuzzyNode - the fuzzy node matched

FuzzyNodeSearchResult

public FuzzyNodeSearchResult(float distance,
                             FuzzyNode<K,T> fuzzyNode,
                             int nodessearched,
                             int nodesmatched,
                             int nodespushed)
Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node

Parameters:
distance - the distance of the match
fuzzyNode - the matching fuzzy node
nodessearched - statistics: nodes searched
nodesmatched - statistics: nodes matched
nodespushed - statistics: nodes pushed

FuzzyNodeSearchResult

public FuzzyNodeSearchResult(float distance,
                             int similarity,
                             float dist,
                             int difference,
                             FuzzyNode<K,T> fuzzyNode,
                             int nodessearched,
                             int nodesmatched,
                             int nodespushed)
Create a FuzzyNodeSearchResult for a given distance (fuzzy node key distance) and the matching fuzzy node

Parameters:
distance - the distance for the fuzzy node keys
similarity - the similarity for the fuzzy node keys
dist - the distance used for the keys searched
difference - the fuzzy node difference
fuzzyNode - the fuzzy node matched
nodessearched - the number of nodes searched
nodesmatched - the number of nodes matches
nodespushed - the number of nodes pushed
Method Detail

format

public java.lang.String format()
format formats a FuzzyNodeResult

Returns:
the formatted FuzzyNodeResult

getDistance

public float getDistance()
Returns:
the distance

getFuzzyNode

public FuzzyNode<K,T> getFuzzyNode()
Returns:
the fuzzyNode

getFuzzyNodedifference

public int getFuzzyNodedifference()
Returns:
the fuzzyNodedifference

getKeyDistance

public float getKeyDistance()
Returns:
the keyDistance

getLevenDistance

public float[] getLevenDistance()
return the Levenshtein distances computed. In most cases this will a % value measuring the similarity with a given search object (100% = perfect match)

Returns:
the levenDistance

getNODESMATCHED

public int getNODESMATCHED()
Returns:
the nODESMATCHED

getNODESPUSHED

public int getNODESPUSHED()
Returns:
the nODESPUSHED

getNODESSEARCHED

public int getNODESSEARCHED()
Returns:
the nODESSEARCHED

getSearchSimilarity

public int getSearchSimilarity()
Returns:
the searchSimilarity

setDistance

public void setDistance(float distance)
Parameters:
distance - the distance to set

setFuzzyNode

public void setFuzzyNode(FuzzyNode<K,T> fuzzyNode)
Parameters:
fuzzyNode - the fuzzyNode to set

setFuzzyNodedifference

public void setFuzzyNodedifference(int fuzzyNodedifference)
Parameters:
fuzzyNodedifference - the fuzzyNodedifference to set

setKeyDistance

public void setKeyDistance(float keyDistance)
Parameters:
keyDistance - the keyDistance to set

setLevenDistance

public void setLevenDistance(float[] levenDistance)
Sets the levenDistance of the result for each of the values of the result node.

Parameters:
levenDistance - the levenDistance to set

setNODESMATCHED

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

setNODESPUSHED

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

setNODESSEARCHED

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

setSearchSimilarity

public void setSearchSimilarity(int searchSimilarity)
Parameters:
searchSimilarity - the searchSimilarity to set