Package org.yaml.snakeyaml.reader
Class StreamReader
java.lang.Object
org.yaml.snakeyaml.reader.StreamReader
Reader: checks if code points are in allowed range. Returns '\0' when end of data has been
reached.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
forward()
void
forward
(int length) read the next length characters and move the pointer.int
int
Get the position of the current char in the current YAML documentint
getIndex()
int
getLine()
getMark()
static boolean
isPrintable
(int c) static boolean
isPrintable
(String data) int
peek()
int
peek
(int index) Peek the next index-th code pointprefix
(int length) peek the next length code pointsprefixForward
(int length) prefix(length) immediately followed by forward(length)void
Reset the position to start (at the start of a new document in the stream)
-
Constructor Details
-
StreamReader
-
StreamReader
-
-
Method Details
-
isPrintable
-
isPrintable
public static boolean isPrintable(int c) -
getMark
-
forward
public void forward() -
forward
public void forward(int length) read the next length characters and move the pointer. if the last character is high surrogate one more character will be read- Parameters:
length
- amount of characters to move forward
-
peek
public int peek() -
peek
public int peek(int index) Peek the next index-th code point- Parameters:
index
- to peek- Returns:
- the next index-th code point
-
prefix
peek the next length code points- Parameters:
length
- amount of the characters to peek- Returns:
- the next length code points
-
prefixForward
prefix(length) immediately followed by forward(length)- Parameters:
length
- amount of characters to get- Returns:
- the next length code points
-
getColumn
public int getColumn() -
getDocumentIndex
public int getDocumentIndex()Get the position of the current char in the current YAML document- Returns:
- index of the current position from the beginning of the current document
-
resetDocumentIndex
public void resetDocumentIndex()Reset the position to start (at the start of a new document in the stream) -
getIndex
public int getIndex()- Returns:
- current position as number (in characters) from the beginning of the stream
-
getLine
public int getLine()
-