|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.sics.prologbeans.Term
se.sics.prologbeans.PBCompound
se.sics.prologbeans.PBList
public class PBList
PBList
is the Java representation of Prolog lists.
Field Summary | |
---|---|
protected Term |
nextTerm
|
Fields inherited from class se.sics.prologbeans.PBCompound |
---|
arguments |
Fields inherited from class se.sics.prologbeans.Term |
---|
name |
Method Summary | |
---|---|
Term |
getArgument(int index)
Returns the first or second argument of this list node. |
int |
getArity()
Returns the number of arguments of this compound term or 0 if this term is not a compound term. |
Term |
getEnd()
Returns the end of this list. |
int |
getLength()
Returns the length of this PBList . |
Term |
getTermAt(int index)
Returns the element at the specified index in this list. |
boolean |
isList()
Returns true if this term is a list and
false otherwise. |
java.lang.String |
toString()
Returns a string description of this term. |
Methods inherited from class se.sics.prologbeans.PBCompound |
---|
isAtom, isAtomic |
Methods inherited from class se.sics.prologbeans.Term |
---|
doubleValue, floatValue, getName, intValue, isCompound, isFloat, isInteger, isString, isVariable, longValue, stuffAtom |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Term nextTerm
Method Detail |
---|
public boolean isList()
Term
true
if this term is a list and
false
otherwise.
isList
in class Term
public Term getArgument(int index)
Due to performance reasons this should be avoided if not 100%
necessary. Please use getTermAt(int index)
for
accessing the elements of lists.
getArgument
in class PBCompound
index
- the (one based) index of the argument
java.lang.IllegalStateException
- if this term is not compoundgetTermAt(int)
public int getArity()
Term
getArity
in class PBCompound
public int getLength()
PBList
.
Please note: this does not correspond to the prolog predicate length/1
.
public Term getTermAt(int index)
index
- the (one based) index of the element in this list
getLength()
public Term getEnd()
public java.lang.String toString()
Term
toString
in class PBCompound
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |