Record Class LiteralImpl<T>

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.model.logicalElements.impl.LiteralImpl<T>
Type Parameters:
T - the native type of the Literal
Record Components:
value - the wrapped literal value
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.elems.ILiteral, fr.inria.rules.dlgpemodel.api.elems.ITerm, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Standardizable, Literal<T>, Substitutable<Term>, Term

public record LiteralImpl<T>(T value) extends Record implements Literal<T>
Default implementation of Literal
Author:
Florent Tornil
  • Constructor Details

    • LiteralImpl

      public LiteralImpl(T value)
      Constructor from a single value
      Parameters:
      value - the value
  • Method Details

    • label

      public String label()
      //////////////////////////////////////////////
      Specified by:
      label in interface Term
      Returns:
      a string representation of this object
    • 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 Literal<T> applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: Term
      Applies a substitution to this term.
      Specified by:
      applySubstitution in interface Literal<T>
      Specified by:
      applySubstitution in interface Substitutable<T>
      Specified by:
      applySubstitution in interface Term
      Parameters:
      substitution - the substitution to apply
      evaluate - whether nested evaluable functions should be evaluated
      Returns:
      the substituted term
    • getRepresentation

      public String getRepresentation()
      Specified by:
      getRepresentation in interface fr.inria.rules.dlgpemodel.api.elems.ILiteral
    • getDatatype

      public String getDatatype()
      Specified by:
      getDatatype in interface fr.inria.rules.dlgpemodel.api.elems.ILiteral
    • 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
    • value

      public T value()
      Returns the value of the value record component.
      Specified by:
      value in interface Literal<T>
      Returns:
      the value of the value record component