Module openj9.dtfj
Class OffsetBasedJavaCoreInputBuffer
java.lang.Object
com.ibm.dtfj.javacore.parser.framework.input.OffsetBasedJavaCoreInputBuffer
- All Implemented Interfaces:
IInputBuffer
- Direct Known Subclasses:
LineJavaCoreInputBuffer
Input buffer that computes character offset from disk.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected StringBuffer
protected int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int i) Retrieves a character at a given position.abstract void
close()
Closes the java.io.Reader or input stream associated with this buffered reader.boolean
protected boolean
int
length()
NOTE That the length of the buffer may vary during character consumption, so it cannot be assumed to be fixed all the time.protected void
markStreamEnd
(boolean mark) protected void
updateOffset
(int length) Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface com.ibm.dtfj.javacore.parser.framework.input.IInputBuffer
consume, nextLine
-
Field Details
-
fOffset
protected int fOffset -
fBuffer
-
DEFAULT_LENGTH
protected static final int DEFAULT_LENGTH- See Also:
-
START_OFFSET
protected static final int START_OFFSET- See Also:
-
-
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 interfaceIInputBuffer
- 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 interfaceIInputBuffer
- 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 interfaceIInputBuffer
- 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
Closes the java.io.Reader or input stream associated with this buffered reader.- Specified by:
close
in interfaceIInputBuffer
- Throws:
IOException
- if error encountered while closing.
-