Interface SeekableMatcher

All Known Implementing Classes:
BoyerMooreMatcher, SeekableMatcherDelegate, SeekableMatcherForByte

public interface SeekableMatcher
A matcher over a Seekable. Invoking next match changes the position of the seekable to the next match if available Matchers may also match in reverse direction If a match is found, the current position of the seekable is assumed to be the start of the match, such that nextPos() / prevPos() move towards the end of the match [< reverse match direction -] [match pos] [ - forward match direction >]
Author:
raven
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    find(Seekable seekable)
    Move the position to the next match.
    boolean
    Whether the matcher matches in forward direction and thus nextPos() moves towards the end of the match.
    void
    Reset the state of the matcher such that it can be used with a fresh seekable
  • Method Details

    • isForward

      boolean isForward()
      Whether 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
      Returns:
    • resetState

      void resetState()
      Reset the state of the matcher such that it can be used with a fresh seekable
    • find

      boolean find(Seekable seekable) throws IOException
      Move 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
      Parameters:
      seekable -
      Returns:
      true if a match was found, false otherwise
      Throws:
      IOException