Class BoyerMooreMatcher
java.lang.Object
org.aksw.commons.io.deprecated.BoyerMooreMatcher
- All Implemented Interfaces:
SeekableMatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]This is the version of a character table that only tracks mismatch on the first instance of a char There is another approach which uses more memory using badCharacterTable[byteValueInText][positionOfMisMatch]protected int[]protected booleanprotected byte[]protected boolean -
Constructor Summary
ConstructorsConstructorDescriptionBoyerMooreMatcher(boolean isFwd, byte[] pat, int[] badCharacter, int[] goodSuffix) -
Method Summary
Modifier and TypeMethodDescriptionbooleanMove the position to the next match.protected bytebooleanWhether the matcher matches in forward direction and thus nextPos() moves towards the end of the match.protected booleanprotected booleanvoidReset the state of the matcher such that it can be used with a fresh seekable
-
Field Details
-
isFwd
protected boolean isFwd -
pat
protected byte[] pat -
badCharacterTable
protected int[] badCharacterTableThis is the version of a character table that only tracks mismatch on the first instance of a char There is another approach which uses more memory using badCharacterTable[byteValueInText][positionOfMisMatch] -
goodSuffixTable
protected int[] goodSuffixTable -
returningFromMatch
protected boolean returningFromMatch
-
-
Constructor Details
-
BoyerMooreMatcher
public BoyerMooreMatcher(boolean isFwd, byte[] pat, int[] badCharacter, int[] goodSuffix)
-
-
Method Details
-
resetState
public void resetState()Description copied from interface:SeekableMatcherReset the state of the matcher such that it can be used with a fresh seekable- Specified by:
resetStatein interfaceSeekableMatcher
-
isForward
public boolean isForward()Description copied from interface:SeekableMatcherWhether the matcher matches in forward direction and thus nextPos() moves towards the end of the match. If false, prevPos() moves towards the end of the match- Specified by:
isForwardin interfaceSeekableMatcher- Returns:
-
nextPos
- Throws:
IOException
-
prevPos
- Throws:
IOException
-
getByte
- Throws:
IOException
-
find
Description copied from interface:SeekableMatcherMove the position to the next match. Position is unspecified if no match was found. TODO Add a horizon argument to limit scanning in case of infinite streams- Specified by:
findin interfaceSeekableMatcher- Parameters:
pn-- Returns:
- true if a match was found, false otherwise
- Throws:
IOException
-