Package jason.asSyntax
Class VarTerm
- All Implemented Interfaces:
ListTerm
,LogicalFormula
,NumberTerm
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
,Iterable<Term>
,Collection<Term>
,List<Term>
,SequencedCollection<Term>
- Direct Known Subclasses:
UnnamedVar
Represents a variable Term: like X (starts with upper case). It may have a
value, after
VarTerm
.apply.
An object of this class can be used in place of a
Literal, Number, List, String, .... It behaves like a
Literal, Number, .... just in case its value is a Literal,
Number, ...- See Also:
-
Field Summary
Fields inherited from class jason.asSyntax.Structure
emptyTermArray, emptyTermList
Fields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
Fields inherited from interface jason.asSyntax.ListTerm
EMPTY_LIST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection c) boolean
addAll
(Collection c) void
adds some terms and return thisprotected int
boolean
to be overridden by subclasses (as internal action)clone and applies together (and faster than clone and then apply)void
clear()
clone()
make a deep copy of the termscloneLT()
clone the list termmake a shallow copy of the list (terms are not cloned, only the structure)clone in another namespaceint
boolean
boolean
void
difference
(ListTerm lt) boolean
get
(int index) int
getArity()
returns the number of terms of this literalget as XMLgetLast()
getNext()
getTail()
getTerm()
getTerm
(int i) returns the i-th term (first term is 0)getTerms()
returns all terms of this literalboolean
int
intersection
(ListTerm lt) boolean
boolean
isAtom()
boolean
boolean
isEmpty()
boolean
isEnd()
boolean
isGround()
boolean
boolean
isList()
boolean
boolean
boolean
boolean
isPred()
boolean
isRule()
boolean
isString()
boolean
boolean
isTail()
boolean
boolean
isVar()
iterator()
int
listIterator
(int index) logicalConsequence
(Agent ag, Unifier un) logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.static VarTerm
Deprecated.prefer ASSyntax.parseVar(...)remove
(int index) boolean
boolean
boolean
reverse()
void
void
void
void
set all terms of the literal and return thisint
size()
double
solve()
returns the numeric value of the termsubList
(int arg0, int arg1) subSets
(int k) returns all subsets that take k elements of this listboolean
Object[]
toArray()
Object[]
Methods inherited from class jason.asSyntax.LiteralImpl
getErrorMsg, getPredicateIndicator, negated, setNegated
Methods inherited from class jason.asSyntax.Pred
addAnnot, addAnnots, addAnnots, addSource, capplyAnnots, clearAnnots, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnot, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, makeVarsAnnon, parsePred, setAnnots, toStringAsTerm
Methods inherited from class jason.asSyntax.Structure
addTerms, delTerm, getSingletonVars, getTermsSize, hasTerm, isUnary, makeTermsAnnon, makeVarsAnnon, parse, toString, varToReplace
Methods inherited from class jason.asSyntax.Atom
getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isMap, isSet, resetHashCodeCache, setSrcInfo
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, hashCode, removeFirst, replaceAll, reversed, sort, spliterator
Methods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isMap, isSet, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Constructor Details
-
VarTerm
-
VarTerm
-
VarTerm
-
-
Method Details
-
parseVar
Deprecated.prefer ASSyntax.parseVar(...) -
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply)- Specified by:
capply
in interfaceTerm
- Overrides:
capply
in classLiteralImpl
-
clone
Description copied from class:Structure
make a deep copy of the terms- Specified by:
clone
in interfaceTerm
- Overrides:
clone
in classLiteralImpl
-
cloneNS
Description copied from interface:Term
clone in another namespace- Specified by:
cloneNS
in interfaceTerm
- Overrides:
cloneNS
in classLiteralImpl
-
cloneLT
Description copied from interface:ListTerm
clone the list term -
isVar
public boolean isVar()- Specified by:
isVar
in interfaceTerm
- Overrides:
isVar
in classDefaultTerm
-
isUnnamedVar
public boolean isUnnamedVar()- Specified by:
isUnnamedVar
in interfaceTerm
- Overrides:
isUnnamedVar
in classDefaultTerm
-
isGround
public boolean isGround() -
equals
- Specified by:
equals
in interfaceCollection<Term>
- Specified by:
equals
in interfaceList<Term>
- Specified by:
equals
in interfaceTerm
- Overrides:
equals
in classLiteralImpl
-
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCode
in classLiteralImpl
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Term>
- Overrides:
compareTo
in classAtom
-
subsumes
-
logicalConsequence
Description copied from class:Literal
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequence
in interfaceLogicalFormula
- Overrides:
logicalConsequence
in classLiteral
-
getTerm
Description copied from class:Literal
returns the i-th term (first term is 0) -
addTerm
-
getArity
public int getArity()Description copied from class:Literal
returns the number of terms of this literal -
getTerms
Description copied from class:Literal
returns all terms of this literal -
setTerms
Description copied from class:Literal
set all terms of the literal and return this -
setTerm
-
addTerms
Description copied from class:Literal
adds some terms and return this -
isInternalAction
public boolean isInternalAction()- Specified by:
isInternalAction
in interfaceTerm
- Overrides:
isInternalAction
in classDefaultTerm
-
isList
public boolean isList()- Specified by:
isList
in interfaceTerm
- Overrides:
isList
in classDefaultTerm
-
isString
public boolean isString()- Specified by:
isString
in interfaceTerm
- Overrides:
isString
in classDefaultTerm
-
isPlanBody
public boolean isPlanBody()- Specified by:
isPlanBody
in interfaceTerm
- Overrides:
isPlanBody
in classDefaultTerm
-
isNumeric
public boolean isNumeric()- Specified by:
isNumeric
in interfaceTerm
- Overrides:
isNumeric
in classDefaultTerm
-
isPred
public boolean isPred() -
isLiteral
public boolean isLiteral() -
isStructure
public boolean isStructure()- Specified by:
isStructure
in interfaceTerm
- Overrides:
isStructure
in classStructure
-
isAtom
public boolean isAtom()- Specified by:
isAtom
in interfaceTerm
- Overrides:
isAtom
in classLiteralImpl
-
isRule
public boolean isRule()- Specified by:
isRule
in interfaceTerm
- Overrides:
isRule
in classDefaultTerm
-
isArithExpr
public boolean isArithExpr()- Specified by:
isArithExpr
in interfaceTerm
- Overrides:
isArithExpr
in classDefaultTerm
-
isCyclicTerm
public boolean isCyclicTerm()- Specified by:
isCyclicTerm
in interfaceTerm
- Overrides:
isCyclicTerm
in classDefaultTerm
-
hasVar
-
countVars
-
canBeAddedInBB
public boolean canBeAddedInBB()Description copied from class:LiteralImpl
to be overridden by subclasses (as internal action)- Overrides:
canBeAddedInBB
in classLiteralImpl
-
solve
Description copied from interface:NumberTerm
returns the numeric value of the term- Specified by:
solve
in interfaceNumberTerm
- Throws:
NoValueException
-
add
-
add
-
addAll
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Term>
- Specified by:
containsAll
in interfaceList<Term>
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<Term>
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<Term>
-
listIterator
- Specified by:
listIterator
in interfaceList<Term>
-
remove
-
remove
-
removeAll
-
retainAll
-
set
-
subList
-
subSets
Description copied from interface:ListTerm
returns all subsets that take k elements of this list -
toArray
-
toArray
-
setTerm
-
setNext
-
append
-
insert
-
concat
-
reverse
-
union
-
intersection
- Specified by:
intersection
in interfaceListTerm
-
difference
- Specified by:
difference
in interfaceListTerm
-
getAsList
-
getLast
-
getPenultimate
- Specified by:
getPenultimate
in interfaceListTerm
-
removeLast
- Specified by:
removeLast
in interfaceList<Term>
- Specified by:
removeLast
in interfaceListTerm
- Specified by:
removeLast
in interfaceSequencedCollection<Term>
-
getNext
-
getTerm
-
isEmpty
public boolean isEmpty() -
isEnd
public boolean isEnd() -
isTail
public boolean isTail() -
setTail
-
getTail
-
listTermIterator
- Specified by:
listTermIterator
in interfaceListTerm
-
size
public int size() -
cloneLTShallow
Description copied from interface:ListTerm
make a shallow copy of the list (terms are not cloned, only the structure)- Specified by:
cloneLTShallow
in interfaceListTerm
-
getAsDOM
get as XML- Specified by:
getAsDOM
in interfaceToDOM
- Overrides:
getAsDOM
in classLiteralImpl
-