Package hydra.parsing
Class ParseError
- java.lang.Object
-
- hydra.parsing.ParseError
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ParseError>
public class ParseError extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<ParseError>
An error which occurred while parsing- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringmessageAn error messagestatic NameMESSAGEName of thehydra.parsing.ParseError.messagefield.java.lang.StringremainderThe remaining input at the point of failurestatic NameREMAINDERName of thehydra.parsing.ParseError.remainderfield.static NameTYPE_Name of thehydra.parsing.ParseErrortype.
-
Constructor Summary
Constructors Constructor Description ParseError(java.lang.String message, java.lang.String remainder)Constructs an immutableParseError.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ParseError other)booleanequals(java.lang.Object other)inthashCode()ParseErrorwithMessage(java.lang.String message)Returns a copy of thisParseErrorwithmessagereplaced.ParseErrorwithRemainder(java.lang.String remainder)Returns a copy of thisParseErrorwithremainderreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.parsing.ParseErrortype.
-
MESSAGE
public static final Name MESSAGE
Name of thehydra.parsing.ParseError.messagefield.
-
REMAINDER
public static final Name REMAINDER
Name of thehydra.parsing.ParseError.remainderfield.
-
message
public final java.lang.String message
An error message
-
remainder
public final java.lang.String remainder
The remaining input at the point of failure
-
-
Constructor Detail
-
ParseError
public ParseError(java.lang.String message, java.lang.String remainder)Constructs an immutableParseError.- Parameters:
message- An error messageremainder- The remaining input at the point of failure
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(ParseError other)
- Specified by:
compareToin interfacejava.lang.Comparable<ParseError>
-
withMessage
public ParseError withMessage(java.lang.String message)
Returns a copy of thisParseErrorwithmessagereplaced.
-
withRemainder
public ParseError withRemainder(java.lang.String remainder)
Returns a copy of thisParseErrorwithremainderreplaced.
-
-