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

## Class ScannerImpl

- java.lang.Object
- - com.hazelcast.org.snakeyaml.engine.v1.scanner.ScannerImpl

- All Implemented Interfaces:
    Scanner, Iterator<Token>

      public final class ScannerImpl
      extends Object
      implements Scanner

       Scanner produces tokens of the following types:
       STREAM-START
       STREAM-END
       DIRECTIVE(name, value)
       DOCUMENT-START
       DOCUMENT-END
       BLOCK-SEQUENCE-START
       BLOCK-MAPPING-START
       BLOCK-END
       FLOW-SEQUENCE-START
       FLOW-MAPPING-START
       FLOW-SEQUENCE-END
       FLOW-MAPPING-END
       BLOCK-ENTRY
       FLOW-ENTRY
       KEY
       VALUE
       ALIAS(value)
       ANCHOR(value)
       TAG(value)
       SCALAR(value, plain, style)
       Read comments in the Scanner code for more details.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScannerImpl(StreamReader reader)`

  - ### Method Summary

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

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

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

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

      `forEachRemaining, remove`

- - ### Constructor Detail

    - #### ScannerImpl

          public ScannerImpl(StreamReader reader)

  - ### Method Detail

    - #### checkToken

          public boolean checkToken(Token.ID... choices)

      Check whether the next token is one of the given types.
      Specified by:
        `checkToken` in interface `Scanner`
      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.

    - #### peekToken

          public Token peekToken()

      Return the next token, but do not delete it from the queue.
      Specified by:
        `peekToken` in interface `Scanner`
      Returns:
        The token that will be returned on the next call to `Scanner.next()`

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Token>`

    - #### next

          public Token next()

      Return the next token, removing it from the queue.
      Specified by:
        `next` in interface `Scanner`
      Specified by:
        `next` in interface `Iterator<Token>`
      Returns:
        the coming token

Copyright © 2019. All rights reserved.