Class AbstractAtomicFormula

java.lang.Object
fr.uga.pddl4j.problem.AbstractAtomicFormula
All Implemented Interfaces:
AtomicFormula, Serializable
Direct Known Subclasses:
Fluent, NumericFluent, Task

public abstract class AbstractAtomicFormula extends Object implements AtomicFormula
This class implements an atomic formula.
Since:
4.0
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractAtomicFormula​(int symbol, int[] arguments)
    Creates a new atomic formula with a specified symbol and list of arguments.
    Creates a new atomic formula from an other formula.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the arity of this atomic formula, i.e., the number of arguments of the atomic formula.
    boolean
    equals​(Object obj)
    Return if a specified object is equals to this atomic formula.
    int[]
    Returns the arguments of the atomic formula.
    int
    Returns the symbol of this atomic formula.
    int
    Returns the hash code value of the atomic formula.
    void
    setArguments​(int[] arguments)
    Sets the arguments of the atomic formula.
    void
    setSymbol​(int symbol)
    Sets the symbole of this atomic formula.
    Returns a string representation of this atomic formula.

    Methods inherited from class java.lang.Object

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

    • AbstractAtomicFormula

      public AbstractAtomicFormula(AbstractAtomicFormula other)
      Creates a new atomic formula from an other formula. This constructor create a deep copy of the formula in parameter.
      Parameters:
      other - the other atomic formula.
    • AbstractAtomicFormula

      public AbstractAtomicFormula(int symbol, int[] arguments)
      Creates a new atomic formula with a specified symbol and list of arguments.
      Parameters:
      symbol - the symbol of the atomic formula.
      arguments - the list of arguments of the atomic formula.
  • Method Details

    • getSymbol

      public final int getSymbol()
      Returns the symbol of this atomic formula.
      Specified by:
      getSymbol in interface AtomicFormula
      Returns:
      the symbol of this atomic formula.
    • setSymbol

      public final void setSymbol(int symbol)
      Sets the symbole of this atomic formula.
      Specified by:
      setSymbol in interface AtomicFormula
      Parameters:
      symbol - the symbol of the atomic fomula.
    • getArguments

      public final int[] getArguments()
      Returns the arguments of the atomic formula.
      Specified by:
      getArguments in interface AtomicFormula
      Returns:
      the arguments of the atomic formula.
    • setArguments

      public final void setArguments(int[] arguments)
      Sets the arguments of the atomic formula.
      Specified by:
      setArguments in interface AtomicFormula
      Parameters:
      arguments - the arguments of the atomic formula.
    • arity

      public final int arity()
      Returns the arity of this atomic formula, i.e., the number of arguments of the atomic formula.
      Specified by:
      arity in interface AtomicFormula
      Returns:
      the arity of this atomic formula.
    • equals

      public boolean equals(Object obj)
      Return if a specified object is equals to this atomic formula. The specified object is equal to the atomic formula if and only if the object is an instance of the class AbstractAtomicFormula and it has the same symbol and list of arguments.
      Overrides:
      equals in class Object
      Parameters:
      obj - the specified object to compared.
      Returns:
      true if the specified object is equal to the atomic formula; false otherwise.
      See Also:
      Object.equals(java.lang.Object)
    • hashCode

      public int hashCode()
      Returns the hash code value of the atomic formula.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value of the atomic formula.
      See Also:
      Object.hashCode()
    • toString

      public String toString()
      Returns a string representation of this atomic formula.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this atomic formula.