Class Message

java.lang.Object
fr.uga.pddl4j.parser.Message
All Implemented Interfaces:
Serializable, Comparable<Message>

public class Message extends Object implements Serializable, Comparable<Message>
This class implements an error message that may generated by the parser.
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This enumeration defines the type of message log in the error manager.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Message​(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 Type
    Method
    Description
    int
    compareTo​(Message other)
    Compare this message to another message.
    boolean
    equals​(Object obj)
    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.
    Returns the file concerned by this message.
    int
    Returns the line of the file concerned by this message.
    Returns the type of the message.
    int
    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
    setFile​(File file)
    Sets the file concerned by this message.
    void
    setLine​(int line)
    Sets the line of the file concerned by this message.
    void
    Sets the type of the message.
    Returns a string representation of this message.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Message

      public Message(Message.Type type, int line, int column, File file, String content)
      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

      public final Message.Type getType()
      Returns the type of the message.
      Returns:
      the type of the message.
    • setType

      public final void setType(Message.Type type)
      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

      public final File getFile()
      Returns the file concerned by this message.
      Returns:
      the file concerned by this message.
    • setFile

      public final void setFile(File file)
      Sets the file concerned by this message.
      Parameters:
      file - the file to set.
    • getContent

      public final String getContent()
      Returns the content of the message.
      Returns:
      the content of the message.
    • setContent

      public final void setContent(String content)
      Sets the content of the message.
      Parameters:
      content - the content to set.
    • equals

      public boolean equals(Object obj)
      Returns if an object is equals to this message. The method returns true if the object is not null and is an instance of the class Message and it has the same line, column and file.
      Overrides:
      equals in class Object
      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:
      hashCode in class Object
      Returns:
      the hash code value of this message.
      See Also:
      Object.hashCode()
    • compareTo

      public int compareTo(Message other)
      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 interface Comparable<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

      public String toString()
      Returns a string representation of this message.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this message.
      See Also:
      Object.toString()