Package mondrian.olap

Class Util.ByteMatcher

java.lang.Object
mondrian.olap.Util.ByteMatcher
Enclosing class:
Util

public static class Util.ByteMatcher extends Object
This class implements the Knuth-Morris-Pratt algorithm to search within a byte array for a token byte array.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteMatcher(byte[] key)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.