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 intprotected StringBufferprotected intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int i) Retrieves a character at a given position.abstract voidclose()Closes the java.io.Reader or input stream associated with this buffered reader.booleanprotected booleanintlength()NOTE That the length of the buffer may vary during character consumption, so it cannot be assumed to be fixed all the time.protected voidmarkStreamEnd(boolean mark) protected voidupdateOffset(int length) Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
endReachedin interfaceIInputBuffer- Returns:
- determines if everything has been consumed from the reader stream.
- See Also:
-
length
public int length()Description copied from interface:IInputBufferNOTE That the length of the buffer may vary during character consumption, so it cannot be assumed to be fixed all the time.- Specified by:
lengthin interfaceIInputBuffer- Returns:
- buffer length
- See Also:
-
charAt
public char charAt(int i) Description copied from interface:IInputBufferRetrieves 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:
charAtin 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:
closein interfaceIInputBuffer- Throws:
IOException- if error encountered while closing.
-