|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mwc.sqld.db.Soundex
Field Summary | |
protected boolean |
DropLastSBoolean
If true, the final 's' of the word being encoded is dropped. |
protected int |
LengthInt
Length of code to build. |
static int |
NO_MAX
Possible code length. |
protected boolean |
PadBoolean
If true, codes are padded to the LengthInt with zeros. |
protected int[] |
SoundexInts
Soundex code table. |
Constructor Summary | |
Soundex()
|
Method Summary | |
protected static int[] |
createArray()
Creates the Soundex code table. |
java.lang.String |
encode(java.lang.String word)
Returns the soundex code for the specified word. |
int |
getCode(char ch)
Returns the Soundex code for the specified character. |
boolean |
getDropLastS()
If true, a final char of 's' or 'S' of the word being encoded will be dropped. |
int |
getLength()
The length of code strings to build, 4 by default. |
boolean |
getPad()
If true, appends zeros to a soundex code if the code is less than Soundex.getLength(). |
static void |
main(java.lang.String[] strings)
Encodes the args to stdout. |
protected java.lang.String |
reduce(java.lang.String word)
Removes adjacent sounds. |
void |
setCode(char ch,
int code)
Allows you to modify the default code table |
void |
setDropLastS(boolean bool)
If true, a final char of 's' or 'S' of the word being encoded will be dropped. |
void |
setLength(int length)
Sets the length of code strings to build. |
void |
setPad(boolean bool)
If true, appends zeros to a soundex code if the code is less than Soundex.getLength(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final transient int NO_MAX
setLength(int)
protected boolean DropLastSBoolean
protected int LengthInt
protected boolean PadBoolean
protected int[] SoundexInts
Constructor Detail |
public Soundex()
Method Detail |
public java.lang.String encode(java.lang.String word)
string
- The word to encode.public int getCode(char ch)
ch
- Should be between A-Z or a-zpublic boolean getDropLastS()
public int getLength()
NO_MAX
public boolean getPad()
public static void main(java.lang.String[] strings)
public void setCode(char ch, int code)
ch
- The character to specify the code for.code
- The code to represent ch with, must be -1, or 1 thru 9public void setDropLastS(boolean bool)
public void setLength(int length)
Length
- of code to produce, must be >= 1public void setPad(boolean bool)
protected static int[] createArray()
protected java.lang.String reduce(java.lang.String word)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |