Class Substitution

java.lang.Object
FAtiMA.Core.wellFormedNames.Substitution
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Inequality

public class Substitution extends Object implements Serializable, Cloneable
Represents a substitution of a variable for another variable or constant symbol
Author:
Joao Dias
See Also:
  • Field Details

    • _value

      protected final Symbol _value
    • _variable

      protected final Symbol _variable
  • Constructor Details

    • Substitution

      public Substitution(Symbol var, Symbol value)
      Creates a new Substitution of the type variable/value
      Parameters:
      var - - the variable to be replaced
      value - - the new value to apply in the place of the old variable
  • Method Details

    • getValue

      public Symbol getValue()
      Gets the substitution's value - Right side
      Returns:
      the right side of the substitution
    • getVariable

      public Symbol getVariable()
      Gets the substitution's variable - Left side
      Returns:
      the left side of the substitution
    • toString

      public String toString()
      Converts the substitution to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String
    • equals

      public boolean equals(Object obj)
      Compares a substitution with a given object
      Overrides:
      equals in class Object
      Parameters:
      obj - - the object to compare
      Returns:
      If the object corresponds to an equal substitution returns true, false otherwise
    • clone

      public Object clone()
      Overrides:
      clone in class Object