Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jason.asSyntax
Class LiteralImpl

    java.lang.Object
      jason.asSyntax.DefaultTerm
          jason.asSyntax.Literal
              jason.asSyntax.Atom
                  jason.asSyntax.Structure
                      jason.asSyntax.Pred
                          jason.asSyntax.LiteralImpl

All Implemented Interfaces:
  LogicalFormula, Term, ToDOM, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Term>

Direct Known Subclasses:
  Rule, VarTerm

    public class LiteralImpl

extends Pred
implements LogicalFormula

A Literal extends a Pred with strong negation (~).

See Also:
  Serialized Form

Field Summary

Fields inherited from class jason.asSyntax.Structure
`emptyTermArray, emptyTermList`

Fields inherited from class jason.asSyntax.Literal
`LFalse, LNeg, LPos, LTrue, predicateIndicatorCache`

Fields inherited from class jason.asSyntax.DefaultTerm
`hashCodeCache, srcInfo`

Constructor Summary
`` | `LiteralImpl(boolean pos, Literal l)` if pos == true, the literal is positive, otherwise it is negative
`` | `LiteralImpl(boolean pos, java.lang.String functor)` if pos == true, the literal is positive, otherwise it is negative
`` | `LiteralImpl(Literal l)`
`` | `LiteralImpl(java.lang.String functor)` creates a positive literal
`protected` | `LiteralImpl(java.lang.String functor, int terms)`

Method Summary
`protected int` | `calcHashCode()`
`boolean` | `canBeAddedInBB()` to be overridden by subclasses (as internal action)
`Term` | `clone()` make a deep copy of the terms
`int` | `compareTo(Term t)`
`boolean` | `equals(java.lang.Object o)`
`org.w3c.dom.Element` | `getAsDOM(org.w3c.dom.Document document)` get as XML
`java.lang.String` | `getErrorMsg()`
`PredicateIndicator` | `getPredicateIndicator()` returns [~] super.getPredicateIndicator
`boolean` | `isAtom()`
`boolean` | `negated()` returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned value
`Literal` | `setNegated(boolean b)` changes the negation of the literal and return this
`java.lang.String` | `toString()`

Methods inherited from class jason.asSyntax.Pred
`addAnnot, addAnnots, addAnnots, addSource, apply, clearAnnots, countVars, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, hasVar, importAnnots, isGround, isPred, makeVarsAnnon, parsePred, setAnnots, toStringAsTerm`

Methods inherited from class jason.asSyntax.Structure
`addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, varToReplace`

Methods inherited from class jason.asSyntax.Atom
`getFunctor`

Methods inherited from class jason.asSyntax.Literal
`copy, forceFullLiteralImpl, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, parseLiteral`

Methods inherited from class jason.asSyntax.DefaultTerm
`getSrcInfo, hashCode, isArithExpr, isInternalAction, isList, isNumeric, isPlanBody, isRule, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface jason.asSyntax.LogicalFormula
`logicalConsequence`

Methods inherited from interface jason.asSyntax.Term
`apply, countVars, getSrcInfo, hasVar, isArithExpr, isGround, isInternalAction, isList, isLiteral, isNumeric, isPlanBody, isPred, isRule, isString, isStructure, isUnnamedVar, isVar, setSrcInfo`

Constructor Detail

### LiteralImpl

    public LiteralImpl(java.lang.String functor)

  creates a positive literal

### LiteralImpl

    public LiteralImpl(boolean pos,
                       java.lang.String functor)

  if pos == true, the literal is positive, otherwise it is negative

### LiteralImpl

    public LiteralImpl(Literal l)

### LiteralImpl

    public LiteralImpl(boolean pos,
                       Literal l)

  if pos == true, the literal is positive, otherwise it is negative

### LiteralImpl

    protected LiteralImpl(java.lang.String functor,
                          int terms)

Method Detail

### isAtom

    public boolean isAtom()

  Specified by:
    `isAtom` in interface `Term`
  Overrides:
    `isAtom` in class `Pred`

### canBeAddedInBB

    public boolean canBeAddedInBB()

  to be overridden by subclasses (as internal action)

  Overrides:
    `canBeAddedInBB` in class `Literal`

### negated

    public boolean negated()

  Description copied from class: `Literal`
  returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned value

  Overrides:
    `negated` in class `Literal`

### setNegated

    public Literal setNegated(boolean b)

  Description copied from class: `Literal`
  changes the negation of the literal and return this

  Overrides:
    `setNegated` in class `Literal`

### equals

    public boolean equals(java.lang.Object o)

  Specified by:
    `equals` in interface `Term`
  Overrides:
    `equals` in class `Pred`

### getErrorMsg

    public java.lang.String getErrorMsg()

  Overrides:
    `getErrorMsg` in class `DefaultTerm`

### compareTo

    public int compareTo(Term t)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<Term>`
  Overrides:
    `compareTo` in class `Pred`

### clone

    public Term clone()

  Description copied from class: `Structure`
  make a deep copy of the terms

  Specified by:
    `clone` in interface `Term`
  Overrides:
    `clone` in class `Pred`

### calcHashCode

    protected int calcHashCode()

  Overrides:
    `calcHashCode` in class `Structure`

### getPredicateIndicator

    public PredicateIndicator getPredicateIndicator()

  returns [~] super.getPredicateIndicator

  Overrides:
    `getPredicateIndicator` in class `Literal`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `Pred`

### getAsDOM

    public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)

  get as XML

  Specified by:
    `getAsDOM` in interface `ToDOM`
  Overrides:
    `getAsDOM` in class `Pred`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD