java.lang.Object
com.maroontress.clione.impl.Eof
- All Implemented Interfaces:
SourceChar
Represents the abstract EOF.
-
Field Summary
Fields inherited from interface com.maroontress.clione.SourceChar
EMPTY_LIST, STATIC_EOF -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract List<SourceChar> Returns the child characters.final StringReturns the filename.abstract SourceSpangetSpan()Returns location of this object in the source file.final booleanisEof()Returns whether this object represents EOF.final chartoChar()Returns acharvalue corresponding to this object.
-
Constructor Details
-
Eof
Creates a new instance.- Parameters:
filename- The filename.
-
-
Method Details
-
getFilename
Returns the filename.- Specified by:
getFilenamein interfaceSourceChar- Returns:
- The filename. Or
nullif no filename is specified.
-
isEof
public final boolean isEof()Returns whether this object represents EOF.- Specified by:
isEofin interfaceSourceChar- Returns:
trueif this represents EOF.
-
toChar
public final char toChar()Returns acharvalue corresponding to this object.This method throws an
IllegalStateExceptionif this object represents EOF.- Specified by:
toCharin interfaceSourceChar- Returns:
- The
charvalue.
-
getSpan
Returns location of this object in the source file.If this object has its child characters, its location depends on their location. So, its location may represent a range of the characters.
This method throws an
IllegalStateExceptionif this object represents EOF.- Specified by:
getSpanin interfaceSourceChar- Returns:
- The location.
-
getChildren
Returns the child characters.- Specified by:
getChildrenin interfaceSourceChar- Returns:
- The unmodifiable list containing the child characters, or
SourceChar.EMPTY_LISTif this object has no child characters.
-