Package mondrian.olap

Class Util.ByteMatcher

  • Enclosing class:
    Util

    public static class Util.ByteMatcher
    extends java.lang.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
      byte[] key  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • key

        public final byte[] key
    • Constructor Detail

      • ByteMatcher

        public ByteMatcher​(byte[] key)
    • Method Detail

      • 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.