Record Class ConstantImpl

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.model.logicalElements.impl.ConstantImpl
Record Components:
label - the constant label
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.elems.IConstant, fr.inria.rules.dlgpemodel.api.elems.ITerm, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Standardizable, Constant, Substitutable<Term>, Term

public record ConstantImpl(String label) extends Record implements Constant
Default implementation of Constant
Author:
Florent Tornil
  • Constructor Details

    • ConstantImpl

      public ConstantImpl(String label)
      Constructor using a simple label
      Parameters:
      label - the string representation of the constant
  • Method Details

    • equals

      public boolean equals(Object o)
      //////////////////////////////////////////////
      Specified by:
      equals in class Record
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • applySubstitution

      public Constant applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: Term
      Applies a substitution to this term.
      Specified by:
      applySubstitution in interface Constant
      Specified by:
      applySubstitution in interface Substitutable<Term>
      Specified by:
      applySubstitution in interface Term
      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.IConstant
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • label

      public String label()
      Returns the value of the label record component.
      Specified by:
      label in interface Term
      Returns:
      the value of the label record component