public final class Commonality extends Object
The GNU Lesser General Public License for details.| Modifier | Constructor and Description |
|---|---|
private |
Commonality()
This is a utility class, therefore the constructor is private.
|
| Modifier and Type | Method and Description |
|---|---|
private static int |
ceil(int number,
int divisor) |
static CommonMiddle |
halfMatch(String source,
String target)
Do the two texts share a substring which is at least half the length of
the longer text?
|
private static CommonMiddle |
halfMatch(String longText,
String shortText,
int startIndex)
Does a substring of shortText exist within longText such that the
substring is at least half the length of longText?
|
static int |
prefix(String source,
String target)
Find the length of a common prefix.
|
static int |
suffix(String source,
String target)
Find the length of a common suffix.
|
private Commonality()
public static int prefix(String source, String target)
source - First stringtarget - Second stringpublic static int suffix(String source, String target)
source - First stringtarget - Second stringpublic static CommonMiddle halfMatch(String source, String target)
source - Baseline stringtarget - Changed stringprivate static CommonMiddle halfMatch(String longText, String shortText, int startIndex)
longText - Longer stringshortText - Shorter stringstartIndex - Start index of quarter length substring within longTextprivate static int ceil(int number,
int divisor)