Package fr.uga.pddl4j.parser
Class Message
java.lang.Object
fr.uga.pddl4j.parser.Message
- All Implemented Interfaces:
Serializable,Comparable<Message>
This class implements an error message that may generated by the parser.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis enumeration defines the type of message log in the error manager. -
Constructor Summary
ConstructorsConstructorDescriptionMessage(Message.Type type, int line, int column, File file, String content)Creates a message with a specified type, line, column, file and content. -
Method Summary
Modifier and TypeMethodDescriptionintCompare this message to another message.booleanReturns if an object is equals to this message.intReturns the column of the file concerned by this message.Returns the content of the message.getFile()Returns the file concerned by this message.intgetLine()Returns the line of the file concerned by this message.getType()Returns the type of the message.inthashCode()Returns the hash code value of this message.voidsetColumn(int column)Sets the column of the file concerned by this message.voidsetContent(String content)Sets the content of the message.voidSets the file concerned by this message.voidsetLine(int line)Sets the line of the file concerned by this message.voidsetType(Message.Type type)Sets the type of the message.toString()Returns a string representation of this message.
-
Constructor Details
-
Message
Creates a message with a specified type, line, column, file and content.- Parameters:
type- the type of message.line- the line of the file concerned by this message.column- the column of the file concerned by this message.file- the file concerned by this message.content- the content of the message.
-
-
Method Details
-
getType
Returns the type of the message.- Returns:
- the type of the message.
-
setType
Sets the type of the message.- Parameters:
type- the type of message to set.
-
getLine
public final int getLine()Returns the line of the file concerned by this message.- Returns:
- the line of the file concerned by this message.
-
setLine
public final void setLine(int line)Sets the line of the file concerned by this message.- Parameters:
line- the line to set.
-
getColumn
public final int getColumn()Returns the column of the file concerned by this message.- Returns:
- the column of the file concerned by this message.
-
setColumn
public final void setColumn(int column)Sets the column of the file concerned by this message.- Parameters:
column- the column to set.
-
getFile
Returns the file concerned by this message.- Returns:
- the file concerned by this message.
-
setFile
Sets the file concerned by this message.- Parameters:
file- the file to set.
-
getContent
Returns the content of the message.- Returns:
- the content of the message.
-
setContent
Sets the content of the message.- Parameters:
content- the content to set.
-
equals
Returns if an object is equals to this message. The method returnstrueif the object is notnulland is an instance of the classMessageand it has the same line, column and file.- Overrides:
equalsin classObject- Parameters:
obj- the other object.- Returns:
trueif an object is equals to this message;false.- See Also:
Object.equals(Object)
-
hashCode
public int hashCode()Returns the hash code value of this message.- Overrides:
hashCodein classObject- Returns:
- the hash code value of this message.
- See Also:
Object.hashCode()
-
compareTo
Compare this message to another message. The order used to compare two messages is the following:- 1. the file concerned according to the alphabetical order.
- 2. the line concerned.
- 3. the line concerned.
- 4. the type of the message.
- Specified by:
compareToin interfaceComparable<Message>- Parameters:
other- the other message.- Returns:
- a negative number if this message comes before the other message, 0 is the message are equals or a positive number if this message comes after the other one according to the defined order.
- See Also:
Comparable.compareTo(Object)
-
toString
Returns a string representation of this message.- Overrides:
toStringin classObject- Returns:
- a string representation of this message.
- See Also:
Object.toString()
-