org.axiondb.functions
Class SoundexFunction

java.lang.Object
  extended byorg.axiondb.BaseSelectable
      extended byorg.axiondb.functions.BaseFunction
          extended byorg.axiondb.functions.SoundexFunction
All Implemented Interfaces:
ConcreteFunction, Function, FunctionFactory, ScalarFunction, Selectable, Serializable
Direct Known Subclasses:
DifferenceFunction, SoundsLikeFunction

public class SoundexFunction
extends BaseFunction
implements ScalarFunction, FunctionFactory

Version:
$Revision: 1.2 $ $Date: 2004/09/09 23:47:44 $
See Also:
Serialized Form

Constructor Summary
SoundexFunction()
          Creates a new instance of Class
SoundexFunction(String name)
          Creates a new instance of Class
 
Method Summary
 Object evaluate(RowDecorator row)
           
 DataType getDataType()
          StringType
 boolean isValid()
           
 ConcreteFunction makeNewInstance()
           
static String soundex(String s)
          Returns a four character code representing the sound of the given String.
 
Methods inherited from class org.axiondb.functions.BaseFunction
addArgument, getAlias, getArgument, getArgumentCount, getLabel, getName, setAlias, setArgument, setName, setVariableContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.axiondb.Function
addArgument, getAlias, getArgument, getArgumentCount, getName, setAlias, setArgument
 
Methods inherited from interface org.axiondb.Selectable
getLabel, setVariableContext
 

Constructor Detail

SoundexFunction

public SoundexFunction()
Creates a new instance of Class


SoundexFunction

public SoundexFunction(String name)
Creates a new instance of Class

Method Detail

makeNewInstance

public ConcreteFunction makeNewInstance()
Specified by:
makeNewInstance in interface FunctionFactory

getDataType

public DataType getDataType()
StringType

Specified by:
getDataType in interface Selectable
Specified by:
getDataType in class BaseFunction

evaluate

public Object evaluate(RowDecorator row)
                throws AxionException
Specified by:
evaluate in interface ScalarFunction
Throws:
AxionException

isValid

public boolean isValid()
Specified by:
isValid in interface ConcreteFunction
Specified by:
isValid in class BaseFunction

soundex

public static String soundex(String s)
Returns a four character code representing the sound of the given String. Non-ASCCI characters in the input String are ignored.

This method was rewritten for Axion to comply with the description at http://www.nara.gov/genealogy/coding.html .

Parameters:
s - the String for which to calculate the 4 character SOUNDEX value
Returns:
the 4 character SOUNDEX value for the given String