Class SeekableMatcherForByte

java.lang.Object
org.aksw.commons.io.seekable.impl.SeekableMatcherForByte
All Implemented Interfaces:
SeekableMatcher

public class SeekableMatcherForByte extends Object implements SeekableMatcher
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected byte
    The byte which to match
    protected boolean
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SeekableMatcherForByte(byte delimiter, boolean isFwd, boolean toLower)
     
  • 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • delimiter

      protected byte delimiter
      The byte which to match
    • isFwd

      protected boolean isFwd
    • toLower

      protected boolean toLower
  • Constructor Details

    • SeekableMatcherForByte

      public SeekableMatcherForByte(byte delimiter, boolean isFwd, boolean toLower)
  • Method Details

    • isForward

      public boolean isForward()
      Description copied from interface: SeekableMatcher
      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
      Specified by:
      isForward in interface SeekableMatcher
      Returns:
    • resetState

      public void resetState()
      Description copied from interface: SeekableMatcher
      Reset the state of the matcher such that it can be used with a fresh seekable
      Specified by:
      resetState in interface SeekableMatcher
    • find

      public boolean find(Seekable seekable) throws IOException
      Description copied from interface: SeekableMatcher
      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
      Specified by:
      find in interface SeekableMatcher
      Returns:
      true if a match was found, false otherwise
      Throws:
      IOException