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
Modifier and TypeClassDescriptionstatic class
This enumeration defines the type of message log in the error manager. -
Constructor Summary
ConstructorDescriptionMessage(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 TypeMethodDescriptionint
Compare this message to another message.boolean
Returns if an object is equals to this message.int
Returns the column of the file concerned by this message.Returns the content of the message.getFile()
Returns the file concerned by this message.int
getLine()
Returns the line of the file concerned by this message.getType()
Returns the type of the message.int
hashCode()
Returns the hash code value of this message.void
setColumn(int column)
Sets the column of the file concerned by this message.void
setContent(String content)
Sets the content of the message.void
Sets the file concerned by this message.void
setLine(int line)
Sets the line of the file concerned by this message.void
setType(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 returnstrue
if the object is notnull
and is an instance of the classMessage
and it has the same line, column and file.- Overrides:
equals
in classObject
- Parameters:
obj
- the other object.- Returns:
true
if 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:
hashCode
in 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:
compareTo
in 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:
toString
in classObject
- Returns:
- a string representation of this message.
- See Also:
Object.toString()
-