|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.hunsicker.util.Lcs
Implementation of the Longest Common Subsequence algorithm.
Constructor Summary | |
Lcs()
Creates a new Lcs object. |
|
Lcs(java.lang.String string1,
java.lang.String string2)
Creates a new Lcs object for the two given strings. |
Method Summary | |
void |
compute()
Computes the longest common subsequence for the two given strings. |
static Lcs |
compute(java.lang.String s1,
java.lang.String s2)
Computes the longest common subsequence for the two given strings. |
int |
getLength()
Returns the longest common subsequence length. |
double |
getPercentage()
Returns the similarity of the strings in percent. |
java.lang.String |
getString()
Returns the longest common subsequence. |
void |
init(java.lang.String s1,
java.lang.String s2)
Sets the two strings to compute the longest common subsequence for and initializes the processing table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Lcs()
public Lcs(java.lang.String string1, java.lang.String string2)
string1
- first string.string2
- second string.Method Detail |
public static Lcs compute(java.lang.String s1, java.lang.String s2)
s1
- first string.s2
- second string.
getString()
,
getLength()
,
getPercentage()
public int getLength()
public double getPercentage()
public java.lang.String getString()
public void compute()
init(String, String)
,
getString()
,
getLength()
,
getPercentage()
public void init(java.lang.String s1, java.lang.String s2)
s1
- first string.s2
- second string.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |