Class GenericByteSequencePattern<T>

  • Type Parameters:
    T - the class of match action, used to specify a specialized momento to be used by the action when it is "applied".

    public class GenericByteSequencePattern<T>
    extends Pattern
    Templated simple DittedBitSequence Pattern for a byte/mask pattern and associated action. The DittedBitSequence is provided by value and mask in byte arrays. This class is normally used to find some number of SequencePatterns within a seqence of bytes. When the byte/mask pattern is matched, the GenericMatchAction will be "applied".
    • Constructor Detail

      • GenericByteSequencePattern

        public GenericByteSequencePattern​(byte[] bytesSequence,
                                          GenericMatchAction<T> action)
        Construct a sequence of bytes with no mask, and associated action to be called if this pattern matches.
        Parameters:
        bytesSequence - sequence of bytes to match
        action - action to apply if the match succeeds
      • GenericByteSequencePattern

        public GenericByteSequencePattern​(byte[] bytesSequence,
                                          byte[] mask,
                                          GenericMatchAction<DataType> action)
        Construct a sequence of bytes with a mask, and associated action to be called if this pattern matches.
        Parameters:
        bytesSequence - sequence of bytes to match
        mask - mask, bits that are 1 must match the byteSequence bits
        action - to apply if the match succeeds