Enum PieceResult
java.lang.Object
java.lang.Enum<PieceResult>
net.diversionmc.parser.expression.PieceResult
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<PieceResult>,java.lang.constant.Constable
public enum PieceResult extends java.lang.Enum<PieceResult>
Piece result shows whether a piece should stop consuming characters or continue.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>> -
Enum Constant Summary
Enum Constants Enum Constant Description CONTINUEAsk for another character to consume.LEAVEStop reading and leave the supplied character.REPLACE_LEAVEStop reading and leave the supplied character, callExpressionPiece.replace(FilePointer)and proceed to read that character in the new piece.REPLACE_TAKEStop reading and consume the supplied character, callExpressionPiece.replace(FilePointer)and proceed to read next characters in the new piece.TAKEStop reading and consume the supplied character. -
Method Summary
Modifier and Type Method Description static PieceResultvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static PieceResult[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Enum Constant Details
-
TAKE
Stop reading and consume the supplied character. The parse pointer will be incremented by 1. Default piece result when a null is given. -
LEAVE
Stop reading and leave the supplied character. The parse pointer will stay as is, leaving the current character for the next piece iteration. -
REPLACE_TAKE
Stop reading and consume the supplied character, callExpressionPiece.replace(FilePointer)and proceed to read next characters in the new piece. Behaves same asTAKEif replacement piece is null, except does not callParser.pieceFinish(Consumer). -
REPLACE_LEAVE
Stop reading and leave the supplied character, callExpressionPiece.replace(FilePointer)and proceed to read that character in the new piece. Behaves same asLEAVEif replacement piece is null, except does not callParser.pieceFinish(Consumer). -
CONTINUE
Ask for another character to consume. The parse pointer will be incremented by 1 andExpressionPiece.read(char, FilePointer)will be called again.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-