Class VariableImpl

java.lang.Object
fr.inria.rules.integraal.model.logicalElements.impl.VariableImpl
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.elems.ITerm, fr.inria.rules.dlgpemodel.api.elems.IVariable, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Standardizable, Substitutable<Term>, Term, Variable
Direct Known Subclasses:
FreshVariableImpl

public class VariableImpl extends Object implements Variable
Default implementation of Variable
Author:
Florent Tornil
  • Constructor Details

    • VariableImpl

      public VariableImpl(String label)
      Constructor using a label
      Parameters:
      label - string representation of the variable
    • VariableImpl

      public VariableImpl(String label, boolean anonymous)
      Creates a variable with an explicit anonymity flag.
      Parameters:
      label - the variable label
      anonymous - whether this variable should be considered anonymous
  • Method Details

    • label

      public String label()
      Description copied from interface: Term
      Returns the textual representation of this term.
      Specified by:
      label in interface Term
      Returns:
      a string representation of this object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • applySubstitution

      public Term applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: Term
      Applies a substitution to this term.
      Specified by:
      applySubstitution in interface Substitutable<Term>
      Specified by:
      applySubstitution in interface Term
      Specified by:
      applySubstitution in interface Variable
      Parameters:
      substitution - the substitution to apply
      evaluate - whether nested evaluable functions should be evaluated
      Returns:
      the substituted term
    • getName

      public String getName()
      Specified by:
      getName in interface fr.inria.rules.dlgpemodel.api.elems.IVariable
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface fr.inria.rules.dlgpemodel.api.elems.IVariable