Class Literal

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Literal>
    Direct Known Subclasses:
    InterpretedLiteral

    public class Literal
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Literal>
    A literal defines a property over parameters. Note that literals can be cloned using the clone() methods.
    See Also:
    Serialized Form
    • Constructor Detail

      • Literal

        public Literal​(java.lang.String property,
                       LiteralParam parameter)
        Creates a monadic literal (with only one parameter).
        Parameters:
        property - The property defined by this literal.
        parameter - The parameter of this literal.
      • Literal

        public Literal​(java.lang.String property,
                       java.util.List<? extends LiteralParam> parameters)
        Creates a literal with a list of parameters.
        Parameters:
        property - The property defined by this literal.
        parameter - The parameters of this literal defined as a list.
      • Literal

        public Literal​(java.lang.String pPropertyWithParams)
        Protected helper constructor. Ensure the literal gets parameters!!
      • Literal

        public Literal​(java.lang.String property2,
                       boolean isPositive)
      • Literal

        public Literal​(java.lang.String property2,
                       java.util.List<? extends LiteralParam> parameters,
                       boolean isPositive)
    • Method Detail

      • getProperty

        public final java.lang.String getProperty()
        Returns a String representation of the property stated by this literal.
      • getPropertyName

        public final java.lang.String getPropertyName()
        Returns only the property name of this literal.
      • getParameters

        public final java.util.List<LiteralParam> getParameters()
        Returns:
        The parameters of this literal in an unmodifiable list.
      • isNegated

        public final boolean isNegated()
      • toggleNegation

        public Literal toggleNegation()
      • getVariableParams

        public final java.util.List<VariableParam> getVariableParams()
        Returns:
        The variable parameters of this literal in an unmodifiable list.
      • getConstantParams

        public final java.util.List<ConstantParam> getConstantParams()
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • clone

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

        public Literal clone​(java.util.Map<? extends VariableParam,​? extends LiteralParam> mapping)
        Creates a copy of this literal on which the given parameter mapping is applied.
        Parameters:
        mapping - A mapping of parameters.
        Returns:
        A copy of this literal on which the given parameter mapping is applied.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(boolean printTypesOfParams)
      • isNegationOf

        public boolean isNegationOf​(Literal l)
      • isPositive

        public boolean isPositive()
      • hasVariableParams

        public boolean hasVariableParams()
      • isGround

        public final boolean isGround()
      • compareTo

        public int compareTo​(Literal l)
        Specified by:
        compareTo in interface java.lang.Comparable<Literal>