Class NamePiece
java.lang.Object
net.diversionmc.parser.util.Pointable
net.diversionmc.parser.expression.ExpressionPiece
net.diversionmc.parser.expression.NamePiece
Reads letters, digits, and some predefined characters.
-
Constructor Summary
ConstructorsConstructorDescriptionNamePiece(FilePointer ptr, String specialChars) Construct a name piece at a position. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck whether a character can be read by a name piece with given special chars.name()Get parsed value of the name piece.read(char c, FilePointer ptr) Parse a character by this piece.toString()Get parsed value of the name piece.Methods inherited from class net.diversionmc.parser.expression.ExpressionPiece
replace
-
Constructor Details
-
NamePiece
Construct a name piece at a position.- Parameters:
ptr- Creation position.specialChars- Additional characters to read.
-
-
Method Details
-
read
Description copied from class:ExpressionPieceParse a character by this piece.- Specified by:
readin classExpressionPiece- Parameters:
c- Character to parse.ptr- Character position in file.- Returns:
PieceResult
-
name
Get parsed value of the name piece.- Returns:
- Name piece value.
-
toString
Get parsed value of the name piece. -
check
Check whether a character can be read by a name piece with given special chars.- Parameters:
c- Character to check.specialChars- Additional characters to read.- Returns:
- True if character is a letter, digit, or in the specialChars supplied.
-