Package mondrian.olap
Class Util.ByteMatcher
java.lang.Object
mondrian.olap.Util.ByteMatcher
- Enclosing class:
- Util
This class implements the Knuth-Morris-Pratt algorithm
to search within a byte array for a token byte array.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
match
(byte[] a) Matches the pre-compiled byte array token against a byte array variable and returns the index of the key within the array.
-
Field Details
-
key
public final byte[] key
-
-
Constructor Details
-
ByteMatcher
public ByteMatcher(byte[] key)
-
-
Method Details
-
match
public int match(byte[] a) Matches the pre-compiled byte array token against a byte array variable and returns the index of the key within the array.- Parameters:
a
- An array of bytes to search for.- Returns:
- -1 if not found, or the index (0 based) of the match.
-