Enum Class PieceResult

java.lang.Object
java.lang.Enum<PieceResult>
net.diversionmc.parser.expression.PieceResult
All Implemented Interfaces:
Serializable, Comparable<PieceResult>, Constable

public enum PieceResult extends Enum<PieceResult>
Piece result shows whether a piece should stop consuming characters or continue.
  • Enum Constant Details

    • TAKE

      public static final PieceResult 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

      public static final PieceResult 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

      public static final PieceResult REPLACE_TAKE
      Stop reading and consume the supplied character, call ExpressionPiece.replace(FilePointer) and proceed to read next characters in the new piece. Behaves same as TAKE if replacement piece is null, except does not call Parser.pieceFinish(Consumer).
    • REPLACE_LEAVE

      public static final PieceResult REPLACE_LEAVE
      Stop reading and leave the supplied character, call ExpressionPiece.replace(FilePointer) and proceed to read that character in the new piece. Behaves same as LEAVE if replacement piece is null, except does not call Parser.pieceFinish(Consumer).
    • CONTINUE

      public static final PieceResult CONTINUE
      Ask for another character to consume. The parse pointer will be incremented by 1 and ExpressionPiece.read(char, FilePointer) will be called again.
  • Method Details

    • values

      public static PieceResult[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PieceResult valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null