Interface Literal<T>

Type Parameters:
T - the native type of the Literal
All Superinterfaces:
fr.inria.rules.dlgpemodel.api.elems.ILiteral, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.elems.ITerm, Standardizable, Substitutable<Term>, Term
All Known Implementing Classes:
LiteralImpl

public interface Literal<T> extends Term, fr.inria.rules.dlgpemodel.api.elems.ILiteral
A Literal is a typed constant representing strings, numbers, dates…
Author:
Florent Tornil
  • Field Summary

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.elems.ILiteral

    BOOLEAN_LITERAL_TYPE, DOUBLE_LITERAL_TYPE, FLOAT_LITERAL_TYPE, INTEGER_LITERAL_TYPE, LONG_LITERAL_TYPE, STRING_LITERAL_TYPE

    Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    WRITER
  • Method Summary

    Modifier and Type
    Method
    Description
    default Literal<T>
    applySubstitution(Substitution substitution, boolean evaluate)
    Applies a substitution to this term.
    default boolean
    Indicates that literals are always ground terms.
    default boolean
    Indicates whether this term is a literal.
    default String
    Returns the standardized textual form.
    Returns the native Java value carried by this literal.

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.elems.ILiteral

    getDatatype, getRepresentation

    Methods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable

    toDLGPE

    Methods inherited from interface Standardizable

    toStandardForm
  • Method Details

    • isLiteral

      default boolean isLiteral()
      Description copied from interface: Term
      Indicates whether this term is a literal.
      Specified by:
      isLiteral in interface Term
      Returns:
      true iff this object is a Literal
    • isGround

      default boolean isGround()
      Indicates that literals are always ground terms.
      Specified by:
      isGround in interface Term
      Returns:
      true
    • value

      T value()
      Returns the native Java value carried by this literal.
      Returns:
      the value of this Literal as a native Java object
    • applySubstitution

      default Literal<T> applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: Term
      Applies a substitution to this term.
      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
    • toStandardForm

      default String toStandardForm(Boolean shortForm)
      Description copied from interface: Standardizable
      Returns the standardized textual form.
      Specified by:
      toStandardForm in interface Standardizable
      Parameters:
      shortForm - indicates whether the generated form should take into account the prefix system
      Returns:
      the standardized form