Package org.eclipse.lemminx.dom.parser

## Class MultiLineStream

- java.lang.Object
- - org.eclipse.lemminx.dom.parser.MultiLineStream

    public class MultiLineStream
    extends Object

Multi line stream.

### Constructor Summary

Constructors
`MultiLineStream​(String source, int position)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `advance​(int n)`
`int` `advanceIfAnyOfChars​(int[] ch)`
`boolean` `advanceIfChar​(int ch)`
`boolean` `advanceIfChars​(int[] ch)`
`String` `advanceIfRegExp​(Pattern regex)`
`String` `advanceIfRegExpGroup1​(Pattern regex)` Advances stream on regex, but will grab the first group
`boolean` `advanceUntilAnyOfChars​(int[] ch)` Will advance until any of the provided chars are encountered
`boolean` `advanceUntilChar​(int ch)` Advances stream.position no matter what until it hits ch or eof(this.len)
`boolean` `advanceUntilCharOrNewTag​(int ch)` Will advance the stream position until ch or '<'
`boolean` `advanceUntilChars​(int[] ch)`
`boolean` `advanceUntilCharsOrNewTag​(int[] ch)` Advances until it matches int[] ch OR it hits '<' If this returns true, peek if next char is '<' to check which case was hit
`boolean` `advanceUntilCharUsingStack​(int closingBracket)` Will advance the stream position until 'closingBracket' or using a stack to consider possible open/closed bracket pairs in between.
`int` `advanceWhileChar​(Predicate<Integer> condition)`
`boolean` `eos()`
`int` `getLastNonWhitespaceOffset()`
`String` `getSource()`
`void` `goBack​(int n)`
`void` `goBackTo​(int pos)`
`void` `goToEnd()`
`int` `peekChar()`
`int` `peekChar​(int n)` Peeks at next char at position + n.
`int` `peekCharAtOffset​(int offset)` Peeks at the char at position 'offset' of the whole document
`int` `pos()`
`boolean` `skipWhitespace()` Advances until it reaches a whitespace character

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MultiLineStream

    public MultiLineStream​(String source,
                           int position)

### Method Detail

#### eos

    public boolean eos()

#### getSource

    public String getSource()

#### pos

    public int pos()

#### goBackTo

    public void goBackTo​(int pos)

#### goBack

    public void goBack​(int n)

#### advance

    public void advance​(int n)

#### goToEnd

    public void goToEnd()

#### peekChar

    public int peekChar()

#### peekChar

    public int peekChar​(int n)

Peeks at next char at position + n. peekChar() == peekChar(0)

Parameters:
  `n` -
Returns:

#### peekCharAtOffset

    public int peekCharAtOffset​(int offset)

Peeks at the char at position 'offset' of the whole document

Parameters:
  `offset` -
Returns:

#### advanceIfChar

    public boolean advanceIfChar​(int ch)

#### advanceIfChars

    public boolean advanceIfChars​(int[] ch)

#### advanceIfAnyOfChars

    public int advanceIfAnyOfChars​(int[] ch)

#### advanceIfRegExp

    public String advanceIfRegExp​(Pattern regex)

#### advanceIfRegExpGroup1

    public String advanceIfRegExpGroup1​(Pattern regex)

Advances stream on regex, but will grab the first group

Parameters:
  `regex` -
Returns:

#### advanceUntilChar

    public boolean advanceUntilChar​(int ch)

Advances stream.position no matter what until it hits ch or eof(this.len)

Returns:
  boolean: was the char found

#### advanceUntilAnyOfChars

    public boolean advanceUntilAnyOfChars​(int[] ch)

Will advance until any of the provided chars are encountered

#### advanceUntilCharOrNewTag

    public boolean advanceUntilCharOrNewTag​(int ch)

Will advance the stream position until ch or '<'

#### advanceUntilCharUsingStack

    public boolean advanceUntilCharUsingStack​(int closingBracket)

Will advance the stream position until 'closingBracket' or using a stack to consider possible open/closed bracket pairs in between. 'closingBracket' should be the closing bracket eg: > | ]

#### advanceUntilChars

    public boolean advanceUntilChars​(int[] ch)

#### advanceUntilCharsOrNewTag

    public boolean advanceUntilCharsOrNewTag​(int[] ch)

Advances until it matches int[] ch OR it hits '<' If this returns true, peek if next char is '<' to check which case was hit

#### skipWhitespace

    public boolean skipWhitespace()

Advances until it reaches a whitespace character

#### advanceWhileChar

    public int advanceWhileChar​(Predicate<Integer> condition)

#### getLastNonWhitespaceOffset

    public int getLastNonWhitespaceOffset()