|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jaxfront.core.util.stringSearch.StringSearch
com.jaxfront.core.util.stringSearch.MismatchSearch
public abstract class MismatchSearch
Subclasses of MismatchSearch allow for searching with a fixed number of
possible errors. Subclasses of this class return a
int
array with the first int
being the position at
which the hit occurred and the second int
being the number of
mismatches at the position.
Example:
int[] positions = new ShiftOrMismatches().searchString("this is null", "nall", 1);positions[0] would be 8, positions[1] (the number of mismatches) would be 1.
Method Summary | |
---|---|
java.lang.Object |
processBytes(byte[] pattern)
Pre-process the pattern, allowing zero errors. |
abstract java.lang.Object |
processBytes(byte[] pattern,
int k)
Pre-processes the pattern, allowing k errors. |
java.lang.Object |
processChars(char[] pattern)
Pre-processes the pattern, allowing zero errors. |
abstract java.lang.Object |
processChars(char[] pattern,
int k)
Pre-processes a char array, allowing k errors. |
java.lang.Object |
processString(java.lang.String pattern,
int k)
Pre-processes a String, allowing k errors. |
int[] |
searchBytes(byte[] text,
byte[] pattern,
int k)
Returns the position in the text at which the pattern was found. |
int[] |
searchBytes(byte[] text,
byte[] pattern,
java.lang.Object processed,
int k)
Returns the position in the text at which the pattern was found. |
int[] |
searchBytes(byte[] text,
int textEnd,
byte[] pattern,
int k)
Returns the position in the text at which the pattern was found. |
int[] |
searchBytes(byte[] text,
int textEnd,
byte[] pattern,
java.lang.Object processed,
int k)
Returns the position in the text at which the pattern was found. |
int[] |
searchBytes(byte[] text,
int textStart,
int textEnd,
byte[] pattern,
int k)
Returns the position in the text at which the pattern was found. |
int |
searchBytes(byte[] text,
int textStart,
int textEnd,
byte[] pattern,
java.lang.Object processed)
Returns the position in the text at which the pattern was found. |
abstract int[] |
searchBytes(byte[] text,
int textStart,
int textEnd,
byte[] pattern,
java.lang.Object processed,
int k)
Returns the position in the text at which the pattern was found. |
int[] |
searchChars(char[] text,
char[] pattern,
int k)
Finder for the given pattern in the text, allowing k errors. |
int[] |
searchChars(char[] text,
char[] pattern,
java.lang.Object processed,
int k)
Finder for the given pattern in the text, allowing k errors. |
int[] |
searchChars(char[] text,
int textStart,
char[] pattern,
int k)
Finder for the given pattern in the text, starting at textStart, allowing k errors. |
int[] |
searchChars(char[] text,
int textStart,
char[] pattern,
java.lang.Object processed,
int k)
Finder for the given pattern in the text, starting at textStart, allowing k errors. |
int[] |
searchChars(char[] text,
int textStart,
int textEnd,
char[] pattern,
int k)
Finder for the given pattern in the text, starting at textStart and comparing to at most textEnd, allowing k errors. |
int |
searchChars(char[] text,
int textStart,
int textEnd,
char[] pattern,
java.lang.Object processed)
Finder for the given pattern in the text, starting at textStart and comparing to at most textEnd, allowing zero errors. |
abstract int[] |
searchChars(char[] text,
int textStart,
int textEnd,
char[] pattern,
java.lang.Object processed,
int k)
Finder for the given pattern in the text, starting at textStart and comparing to at most textEnd, allowing k errors. |
int[] |
searchString(java.lang.String text,
int textStart,
int textEnd,
java.lang.String pattern,
int k)
Convenience method to search for patterns in Strings. |
int[] |
searchString(java.lang.String text,
int textStart,
int textEnd,
java.lang.String pattern,
java.lang.Object processed,
int k)
Convenience method to search for patterns in Strings. |
int[] |
searchString(java.lang.String text,
int textStart,
java.lang.String pattern,
int k)
Convenience method to search for patterns in Strings. |
int[] |
searchString(java.lang.String text,
int textStart,
java.lang.String pattern,
java.lang.Object processed,
int k)
Convenience method to search for patterns in Strings. |
int[] |
searchString(java.lang.String text,
java.lang.String pattern,
int k)
Convenience method to search for patterns in Strings. |
int[] |
searchString(java.lang.String text,
java.lang.String pattern,
java.lang.Object processed,
int k)
Convenience method to search for patterns in Strings. |
Methods inherited from class com.jaxfront.core.util.stringSearch.StringSearch |
---|
equals, getAllOccurences, hashCode, processString, searchBytes, searchBytes, searchBytes, searchBytes, searchBytes, searchChars, searchChars, searchChars, searchChars, searchChars, searchString, searchString, searchString, searchString, searchString, searchString, toString, toStringBuffer, usesNative, usesReflection |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final java.lang.Object processBytes(byte[] pattern)
process(pattern, 0)
processBytes
in class StringSearch
pattern
- the byte
array containing the pattern, may not
be null
com.eaio.stringsearch.StringSearch#processBytes(byte[])
,
processBytes(byte[], int)
public abstract java.lang.Object processBytes(byte[] pattern, int k)
pattern
- the byte
array containing the pattern, may not
be null
k
- the editing distance
public final java.lang.Object processChars(char[] pattern)
process(pattern, 0)
.
processChars
in class StringSearch
pattern
- a char
array containing the pattern, may not be
null
processChars(char[], int)
,
com.eaio.stringsearch.StringSearch#processChars(char[])
public abstract java.lang.Object processChars(char[] pattern, int k)
char
array, allowing k errors.
pattern
- a char
array containing the pattern, may not be
null
k
- the editing distance
public final java.lang.Object processString(java.lang.String pattern, int k)
StringSearch.searchString(String, String)
methods.
pattern
- the String containing the pattern, may not be
null
k
- the editing distance
public final int searchBytes(byte[] text, int textStart, int textEnd, byte[] pattern, java.lang.Object processed)
StringSearch
searchBytes
in class StringSearch
text
- text the byte
array containing the text, may
not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the pattern to search for, may not be null
processed
- an Object as returned from StringSearch.processBytes(byte[])
, may
not be null
com.eaio.stringsearch.StringSearch#searchBytes(byte[], int, int, byte[], Object)
,
searchBytes(byte[], int, int, byte[], Object, int)
public final int[] searchBytes(byte[] text, byte[] pattern, int k)
text
- the byte
array containing the text, may not be
null
pattern
- the byte
array containing the pattern, may not
be null
k
- the editing distance
searchBytes(byte[], int, int, byte[], Object, int)
public final int[] searchBytes(byte[] text, byte[] pattern, java.lang.Object processed, int k)
text
- the byte
array containing the text, may not be
null
pattern
- the byte
array containing the pattern, may not
be null
processed
- an Object as returned from
processBytes(byte[], int)
, may not be null
k
- the editing distance
searchBytes(byte[], int, int, byte[], Object, int)
public final int[] searchBytes(byte[] text, int textEnd, byte[] pattern, int k)
text
- the byte
array containing the text, may not be
null
textStart
- at which position in the text the comparing should startpattern
- the byte
array containing the pattern, may not
be null
k
- the editing distance
searchBytes(byte[], int, int, byte[], Object, int)
public final int[] searchBytes(byte[] text, int textEnd, byte[] pattern, java.lang.Object processed, int k)
text
- the byte
array containing the text, may not be
null
textStart
- at which position in the text the comparing should startpattern
- the pattern to search for, may not be null
processed
- k
- the editing distance
searchBytes(byte[], int, int, byte[], Object, int)
public final int[] searchBytes(byte[] text, int textStart, int textEnd, byte[] pattern, int k)
text
- text the byte
array containing the text, may not be
null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the byte
array containing the pattern, may not
be null
k
- the editing distance
searchBytes(byte[], int, int, byte[], Object, int)
public abstract int[] searchBytes(byte[] text, int textStart, int textEnd, byte[] pattern, java.lang.Object processed, int k)
text
- text the byte
array containing the text, may not be
null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the pattern to search for, may not be null
processed
- an Object as returned from
processBytes(byte[], int)
, may not be null
k
- the editing distance
processBytes(byte[], int)
public final int searchChars(char[] text, int textStart, int textEnd, char[] pattern, java.lang.Object processed)
searchChars
in class StringSearch
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the pattern to search for, may not be null
processed
- an Object as returned from StringSearch.processChars(char[])
or
StringSearch.processString(String)
, may not be null
StringSearch.searchChars(char[], int, int, char[], Object)
,
processChars(char[], int)
public final int[] searchChars(char[] text, char[] pattern, int k)
text
- the String containing the text, may not be null
pattern
- the pattern to search for, may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
public final int[] searchChars(char[] text, char[] pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
pattern
- the pattern to search for, may not be null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
public final int[] searchChars(char[] text, int textStart, char[] pattern, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should startpattern
- the pattern to search for, may not be null
processed
- an Object as returned from
processChars(char[], int)
or #processString(String), int
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object)
public final int[] searchChars(char[] text, int textStart, char[] pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should startpattern
- the pattern to search for, may not be null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
public final int[] searchChars(char[] text, int textStart, int textEnd, char[] pattern, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the pattern to search for, may not be null
k
- the maximum number of mismatches (the editing distance)
public abstract int[] searchChars(char[] text, int textStart, int textEnd, char[] pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the pattern to search for, may not be null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
public final int[] searchString(java.lang.String text, java.lang.String pattern, int k)
text
- the String containing the text, may not be null
pattern
- the String containing the pattern, may not be
null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], int)
public final int[] searchString(java.lang.String text, java.lang.String pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
pattern
- the String containing the pattern, may not be
null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
public final int[] searchString(java.lang.String text, int textStart, java.lang.String pattern, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should startpattern
- the String containing the pattern, may not be
null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], int)
public final int[] searchString(java.lang.String text, int textStart, java.lang.String pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should startpattern
- the String containing the pattern, may not be
null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
public final int[] searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the String containing the pattern, may not be
null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], int)
public final int[] searchString(java.lang.String text, int textStart, int textEnd, java.lang.String pattern, java.lang.Object processed, int k)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should starttextEnd
- at which position in the text comparing should stoppattern
- the String containing the pattern, may not be
null
processed
- an Object as returned from
processChars(char[], int)
or processString(String, int)
,
may not be null
k
- the maximum number of mismatches (the editing distance)
searchChars(char[], int, int, char[], Object, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |