Module openj9.dtfj

Class OffsetBasedJavaCoreInputBuffer

java.lang.Object
com.ibm.dtfj.javacore.parser.framework.input.OffsetBasedJavaCoreInputBuffer
All Implemented Interfaces:
IInputBuffer
Direct Known Subclasses:
LineJavaCoreInputBuffer

public abstract class OffsetBasedJavaCoreInputBuffer extends Object implements IInputBuffer
Input buffer that computes character offset from disk.
  • Field Details

  • Constructor Details

    • OffsetBasedJavaCoreInputBuffer

      public OffsetBasedJavaCoreInputBuffer()
  • Method Details

    • markStreamEnd

      protected void markStreamEnd(boolean mark)
    • isStreamEnd

      protected boolean isStreamEnd()
    • endReached

      public boolean endReached()
      Specified by:
      endReached in interface IInputBuffer
      Returns:
      determines if everything has been consumed from the reader stream.
      See Also:
    • length

      public int length()
      Description copied from interface: IInputBuffer
      NOTE That the length of the buffer may vary during character consumption, so it cannot be assumed to be fixed all the time.
      Specified by:
      length in interface IInputBuffer
      Returns:
      buffer length
      See Also:
    • charAt

      public char charAt(int i)
      Description copied from interface: IInputBuffer
      Retrieves a character at a given position. No consumption occurs. Typically used by an external scanner to determine if a sequence of characters in the buffer matches a desired pattern. If so, the pattern is consumed by a consume method.
      Specified by:
      charAt in interface IInputBuffer
      Parameters:
      buffer - index where character is located
      Returns:
      character at specified index
      See Also:
    • updateOffset

      protected void updateOffset(int length)
      Parameters:
      length - to add to current offset
    • close

      public abstract void close() throws IOException
      Closes the java.io.Reader or input stream associated with this buffered reader.
      Specified by:
      close in interface IInputBuffer
      Throws:
      IOException - if error encountered while closing.