public class ListTermImpl extends Structure implements ListTerm
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LIST_FUNCTOR |
emptyTermArray, emptyTermList
LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
hashCodeCache, srcInfo
Constructor and Description |
---|
ListTermImpl() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Term o) |
boolean |
add(Term o) |
boolean |
addAll(java.util.Collection c) |
boolean |
addAll(int index,
java.util.Collection c) |
void |
addTerm(Term t) |
ListTerm |
append(Term t)
Adds a term in the end of the list
|
int |
calcHashCode() |
ListTerm |
capply(Unifier u)
make a hard copy of the terms
|
void |
clear() |
ListTerm |
clone()
make a hard copy of the terms
|
ListTerm |
cloneLT()
make a hard copy of the terms
|
ListTerm |
cloneLTShallow()
make a shallow copy of the list (terms are not cloned, only the structure)
|
int |
compareTo(Term o) |
ListTerm |
concat(ListTerm lt)
Adds a list in the end of this list.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
ListTerm |
difference(ListTerm lt)
returns a new (cloned) list representing the set resulting of the difference of this list and lt.
|
boolean |
equals(java.lang.Object t) |
Term |
get(int index) |
int |
getArity()
returns the number of terms of this literal
|
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
get as XML
|
java.util.List<Term> |
getAsList()
Returns this ListTerm as a Java List (implemented by ArrayList).
|
ListTerm |
getLast()
get the last ListTerm of this List
|
ListTerm |
getNext() |
ListTerm |
getPenultimate() |
VarTerm |
getTail()
returns this ListTerm's tail element in case the List has the Tail, otherwise, returns null
|
Term |
getTerm()
gets the term of this ListTerm
|
Term |
getTerm(int i)
returns the i-th term (first term is 0)
|
java.util.List<Term> |
getTerms()
return the this ListTerm elements (0=Term, 1=ListTerm)
|
int |
indexOf(java.lang.Object o) |
ListTerm |
insert(Term t)
insert a term in the begin of this list
|
ListTerm |
intersection(ListTerm lt)
returns a new (cloned) list representing the set resulting of the intersection of this list and lt.
|
boolean |
isAtom() |
boolean |
isEmpty() |
boolean |
isEnd() |
boolean |
isGround() |
boolean |
isList() |
boolean |
isLiteral() |
boolean |
isTail() |
java.util.Iterator<Term> |
iterator()
returns an iterator where each element is a Term of this list,
the tail of the list is not considered.
|
int |
lastIndexOf(java.lang.Object arg0) |
java.util.ListIterator<Term> |
listIterator() |
java.util.ListIterator<Term> |
listIterator(int startIndex) |
java.util.Iterator<ListTerm> |
listTermIterator()
gives an iterator that includes the final empty list or tail,
for [a,b,c] returns [a,b,c]; [b,c]; [c]; and [].
|
java.util.Iterator<Unifier> |
logicalConsequence(Agent ag,
Unifier un)
logicalConsequence checks whether one particular predicate
is a logical consequence of the belief base.
|
static ListTerm |
parseList(java.lang.String sList) |
Term |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
Term |
removeLast() |
boolean |
retainAll(java.util.Collection c) |
ListTerm |
reverse()
Creates a new (cloned) list with the same elements of this list, but in the reversed order.
|
Term |
set(int index,
Term t) |
void |
setNext(Term l) |
void |
setTail(VarTerm v)
set the tail of this list
|
void |
setTerm(int i,
Term t) |
void |
setTerm(Term t) |
protected void |
setValuesFrom(ListTerm lt) |
int |
size() |
java.util.List<Term> |
subList(int arg0,
int arg1) |
java.util.Iterator<java.util.List<Term>> |
subSets(int k)
returns all subsets that take k elements of this list
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
ListTerm |
union(ListTerm lt)
returns a new (cloned) list representing the set resulting of the union of this list and lt.
|
addTerms, addTerms, countVars, delTerm, getSingletonVars, getTermsSize, hasTerm, hasVar, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerms, subsumes, varToReplace
getFunctor
addAnnot, addAnnots, addAnnots, addSource, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, negated, newFromListOfTerms, parseLiteral, setAnnots, setNegated
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isNumeric, isPlanBody, isPred, isRule, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
finalize, getClass, notify, notifyAll, wait, wait, wait
countVars, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isCyclicTerm, isInternalAction, isNumeric, isPlanBody, isPred, isRule, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
public static final java.lang.String LIST_FUNCTOR
public static ListTerm parseList(java.lang.String sList)
public ListTerm clone()
public ListTerm cloneLT()
public ListTerm cloneLTShallow()
cloneLTShallow
in interface ListTerm
public boolean equals(java.lang.Object t)
public int calcHashCode()
calcHashCode
in class Structure
public int compareTo(Term o)
public Term getTerm()
public int getArity()
Literal
public Term getTerm(int i)
Literal
public java.util.List<Term> getTerms()
public int size()
public boolean isAtom()
public boolean isList()
isList
in interface Term
isList
in class DefaultTerm
public boolean isLiteral()
public boolean isEmpty()
public boolean isGround()
public java.util.Iterator<Unifier> logicalConsequence(Agent ag, Unifier un)
Literal
logicalConsequence
in interface LogicalFormula
logicalConsequence
in class Literal
public VarTerm getTail()
public void setTail(VarTerm v)
public ListTerm getLast()
public ListTerm getPenultimate()
getPenultimate
in interface ListTerm
public Term removeLast()
removeLast
in interface ListTerm
public ListTerm concat(ListTerm lt)
public ListTerm reverse()
public ListTerm union(ListTerm lt)
public ListTerm intersection(ListTerm lt)
intersection
in interface ListTerm
public ListTerm difference(ListTerm lt)
difference
in interface ListTerm
public java.util.Iterator<java.util.List<Term>> subSets(int k)
public java.util.Iterator<ListTerm> listTermIterator()
listTermIterator
in interface ListTerm
public java.util.Iterator<Term> iterator()
public java.util.List<Term> getAsList()
public boolean add(Term o)
public boolean addAll(java.util.Collection c)
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List<Term>
public void clear()
public boolean contains(java.lang.Object o)
public boolean containsAll(java.util.Collection c)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<Term>
public int lastIndexOf(java.lang.Object arg0)
lastIndexOf
in interface java.util.List<Term>
public java.util.ListIterator<Term> listIterator()
listIterator
in interface java.util.List<Term>
public java.util.ListIterator<Term> listIterator(int startIndex)
listIterator
in interface java.util.List<Term>
protected void setValuesFrom(ListTerm lt)
public boolean remove(java.lang.Object o)
public boolean removeAll(java.util.Collection c)
public boolean retainAll(java.util.Collection c)
public java.util.List<Term> subList(int arg0, int arg1)
subList
in interface java.util.List<Term>
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)