API

class javalikescanner.JavaLikeScanner(contents)[source]

A class which allows a given string to be scanned through and broken up into various tokens.

has_next()[source]

Return whether or not there is a valid next token in the scanner or not.

Returns:Whether or not there is a next token in the scanner as a boolean.
has_next_int()[source]

Return whether the next token in the scanner is an integer or not.

Returns:Whether or not the next token in the scanner is an integer as a boolean.
has_next_line()[source]

Return whether or not there is a next line in the scanner.

Returns:Whether or not there is a next line in the scanner as a boolean.
next()[source]

Return the next token in the scanner and remove that token from the scanner.

Returns None if there is no next token in the scanner.

Returns:The next token in the scanner as a string.
next_int()[source]

Return the next integer in the scanner and remove that integer from the scanner.

Returns None if there is not a next token in the scanner, or if the next token in the scanner is not an integer.

Returns:The next integer in the scanner as an integer.
next_line()[source]

Return the next line in the scanner and remove that line from the scanner.

Returns None if there is not a next line in the scanner.

Returns:The next line in the scanner as a string.