public class BNDMWildcards extends BNDM
processChars(char[], char)
and the
(byte[], byte)
methods. Preprocessing: O(2m + ∑) time
processBytes(byte[], byte)
,
processChars(char[], char)
,
BNDM
Modifier and Type | Field and Description |
---|---|
static char |
wildcard
The wildcard character (initially '?').
|
Constructor and Description |
---|
BNDMWildcards()
Constructor for BNDMWildcards.
|
Modifier and Type | Method and Description |
---|---|
protected libsidutils.stringsearch.CharIntMap |
createCharIntMap(char[] pattern)
Returns a
CharIntMap of the extent of the given pattern, using no
default value. |
protected libsidutils.stringsearch.CharIntMap |
createCharIntMap(char[] pattern,
int defaultValue)
Returns a
CharIntMap of the extent of the given pattern, using
the specified default value. |
boolean |
equals(Object obj)
Returns if the Object's class name matches this Object's class name.
|
int |
hashCode()
Returns the hashCode of the Object's Class because all instances of this
Class are equal.
|
protected int |
index(byte idx)
Converts the given
byte to an int . |
Object |
processBytes(byte[] pattern)
Pre-processing of the pattern.
|
Object |
processBytes(byte[] pattern,
byte w)
Pre-processing of the pattern.
|
Object |
processChars(char[] pattern)
Pre-processes the pattern.
|
Object |
processChars(char[] pattern,
char w)
Pre-processes the pattern.
|
Object |
processString(String pattern,
char w)
Pre-processes the pattern.
|
int |
searchBytes(byte[] text,
byte[] pattern)
Returns the position in the text at which the pattern was found.
|
int |
searchBytes(byte[] text,
byte[] pattern,
Object processed)
Returns the position in the text at which the pattern was found.
|
int |
searchBytes(byte[] text,
int textStart,
byte[] pattern)
Returns the position in the text at which the pattern was found.
|
int |
searchBytes(byte[] text,
int textStart,
byte[] pattern,
Object processed)
Returns the position in the text at which the pattern was found.
|
int |
searchBytes(byte[] text,
int textStart,
int textEnd,
byte[] pattern)
Returns the position in the text at which the pattern was found.
|
int |
searchChars(char[] text,
char[] pattern)
Returns the position in the text at which the pattern was found.
|
int |
searchChars(char[] text,
char[] pattern,
Object processed)
Returns the index of the pattern in the text using the pre-processed
Object.
|
int |
searchChars(char[] text,
int textStart,
char[] pattern)
Returns the position in the text at which the pattern was found.
|
int |
searchChars(char[] text,
int textStart,
char[] pattern,
Object processed)
Returns the index of the pattern in the text using the pre-processed
Object.
|
int |
searchChars(char[] text,
int textStart,
int textEnd,
char[] pattern)
Returns the position in the text at which the pattern was found.
|
String |
toString()
Returns a String representation of this.
|
StringBuffer |
toStringBuffer(StringBuffer in)
Appends a String representation of this to the given
StringBuffer
or creates a new one if none is given. |
searchBytes, searchChars
public BNDMWildcards()
public Object processBytes(byte[] pattern)
wildcard
field.
com.eaio.stringsearch.StringSearch#processBytes(byte[])processBytes
in class BNDM
pattern
- the byte
array containing the pattern, may not be
null
processBytes(byte[], byte)
public Object processBytes(byte[] pattern, byte w)
int
array.pattern
- the byte
array containing the pattern, may not be
null
w
- the wildcard byte
characterint
arraypublic Object processChars(char[] pattern)
wildcard
field.processChars
in class BNDM
pattern
- the char
array containing the pattern, may not be
null
CharIntMap
StringSearch.processChars(char[])
,
processChars(char[], char)
public Object processChars(char[] pattern, char w)
CharIntMap
.pattern
- the char
array containing the pattern, may not be
null
w
- the wildcard characterCharIntMap
.public Object processString(String pattern, char w)
CharIntMap
.pattern
- the String array containing the pattern, may not be
null
w
- the wildcard characterCharIntMap
.public final int searchBytes(byte[] text, byte[] pattern)
text
- the byte
array containing the text, may not be
null
pattern
- the byte
array containing the pattern, may not be
null
searchBytes(byte[], int, int, byte[], Object)
public final int searchBytes(byte[] text, byte[] pattern, Object processed)
text
- the byte
array containing the text, may not be
null
pattern
- the pattern to search for, may not be null
processed
- an Object as returned from processBytes(byte[])
, may
not be null
searchBytes(byte[], int, int, byte[], Object)
public final int searchBytes(byte[] text, int textStart, byte[] pattern)
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
searchBytes(byte[], int, int, byte[], Object)
public final int searchBytes(byte[] text, int textStart, byte[] pattern, Object processed)
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
- searchBytes(byte[], int, int, byte[], Object)
public final int searchBytes(byte[] text, int textStart, int textEnd, byte[] pattern)
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
searchBytes(byte[], int, int, byte[], Object)
public final int searchChars(char[] text, char[] pattern)
text
- the character array containing the text, may not be
null
pattern
- the char
array containing the pattern, may not be
null
searchChars(char[], int, int, char[], Object)
public final int searchChars(char[] text, char[] pattern, Object processed)
text
- the character array containing the text, may not be
null
pattern
- the char
array containing the pattern, may not be
null
processed
- an Object as returned from processChars(char[])
, may
not be null
searchChars(char[], int, int, char[], Object)
public final int searchChars(char[] text, int textStart, char[] pattern)
text
- the character array containing the text, may not be
null
textStart
- at which position in the text the comparing should startpattern
- the char
array containing the pattern, may not be
null
searchChars(char[], int, int, char[], Object)
public final int searchChars(char[] text, int textStart, char[] pattern, Object processed)
text
- the String containing the text, may not be null
textStart
- at which position in the text the comparing should startpattern
- the char
array containing the pattern, may not be
null
processed
- an Object as returned from processChars(char[])
, may
not be null
searchChars(char[], int, int, char[], Object)
public final int searchChars(char[] text, int textStart, int textEnd, char[] pattern)
text
- the character 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 char
array containing the pattern, may not be
null
searchChars(char[], int, int, char[], Object)
public final boolean equals(Object obj)
equals
in class Object
obj
- the other ObjectObject.equals(Object)
public final int hashCode()
hashCode
in class Object
Object.hashCode()
public final String toString()
toString
in class Object
Object.toString()
public StringBuffer toStringBuffer(StringBuffer in)
StringBuffer
or creates a new one if none is given. This method is not
final
because subclasses might want a different String
format.in
- the StringBuffer to append to, may be null
protected libsidutils.stringsearch.CharIntMap createCharIntMap(char[] pattern)
CharIntMap
of the extent of the given pattern, using no
default value.pattern
- the patternCharIntMap.CharIntMap(int, char)
protected libsidutils.stringsearch.CharIntMap createCharIntMap(char[] pattern, int defaultValue)
CharIntMap
of the extent of the given pattern, using
the specified default value.pattern
- the patterndefaultValue
- the default valueCharIntMap.CharIntMap(int, char, int)
protected final int index(byte idx)
byte
to an int
.idx
- the byteCopyright © 2018 Ken Händel. All rights reserved.