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 Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_LENGTH
protected StringBuffer
fBuffer
protected int
fOffset
protected static int
START_OFFSET
-
Constructor Summary
Constructors Constructor Description OffsetBasedJavaCoreInputBuffer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description char
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
endReached()
protected boolean
isStreamEnd()
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 Detail
-
fOffset
protected int fOffset
-
fBuffer
protected StringBuffer fBuffer
-
DEFAULT_LENGTH
protected static final int DEFAULT_LENGTH
- See Also:
- Constant Field Values
-
START_OFFSET
protected static final int START_OFFSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:
IInputBuffer.endReached()
-
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:
IInputBuffer.length()
-
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:
IInputBuffer.charAt(int)
-
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 interfaceIInputBuffer
- Throws:
IOException
- if error encountered while closing.
-
-