com.hazelcast.org.snakeyaml.engine.v1.scanner

## Interface Scanner

- All Superinterfaces:
    Iterator<Token>
  All Known Implementing Classes:
    ScannerImpl

      public interface Scanner
      extends Iterator<Token>

  This interface represents an input stream of `Token`s.

  The scanner and the scanner form together the 'Parse' step in the loading process.

  See Also:
    `Token`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkToken(Token.ID... choices)` Check if the next token is one of the given types.
    `Token` | `next()` Returns the next token.
    `Token` | `peekToken()` Return the next token, but do not delete it from the stream.

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining, hasNext, remove`

- - ### Method Detail

    - #### checkToken

          boolean checkToken(Token.ID... choices)

      Check if the next token is one of the given types.
      Parameters:
        `choices` - token IDs.
      Returns:
        `true` if the next token can be assigned to a variable of at least one of the given types. Returns `false` if no more tokens are available.
      Throws:
        `ScannerException` - Thrown in case of malformed input.

    - #### peekToken

          Token peekToken()

      Return the next token, but do not delete it from the stream. The method must be called only after `checkToken(com.hazelcast.org.snakeyaml.engine.v1.tokens.Token.ID...)`.
      Returns:
        The token that will be returned on the next call to `next()`
      Throws:
        `ScannerException` - Thrown in case of malformed input.
        `IndexOutOfBoundsException` - if no more token left

    - #### next

          Token next()

      Returns the next token.

      The token will be removed from the stream. (Every invocation of this method must happen after calling `checkToken(com.hazelcast.org.snakeyaml.engine.v1.tokens.Token.ID...)`.

      Specified by:
        `next` in interface `Iterator<Token>`
      Returns:
        the coming token
      Throws:
        `ScannerException` - Thrown in case of malformed input.
        `IndexOutOfBoundsException` - if no more token left

Copyright © 2019. All rights reserved.