Class Substitution

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    Inequality

    public class Substitution
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    Represents a substitution of a variable for another variable or constant symbol
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Substitution​(Symbol var, Symbol value)
      Creates a new Substitution of the type variable/value
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      boolean equals​(java.lang.Object obj)
      Compares a substitution with a given object
      Symbol getValue()
      Gets the substitution's value - Right side
      Symbol getVariable()
      Gets the substitution's variable - Left side
      java.lang.String toString()
      Converts the substitution to a String
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _value

        protected final Symbol _value
      • _variable

        protected final Symbol _variable
    • Constructor Detail

      • 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 Detail

      • 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 java.lang.String toString()
        Converts the substitution to a String
        Overrides:
        toString in class java.lang.Object
        Returns:
        the converted String
      • equals

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

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object