|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--se.sics.prologbeans.Term
|
+--se.sics.prologbeans.PBCompound
|
+--se.sics.prologbeans.PBList
|
+--se.sics.prologbeans.PBString
PBString is the Java representation of Prolog strings
(e.g. lists of integers that are interpretable as characters).
| Fields inherited from class se.sics.prologbeans.PBList |
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. |
char |
getCharAt(int index)
Returns the character at the specified index in this string. |
int |
getLength()
Returns the number of characters in this PBString. |
java.lang.String |
getString()
Returns the string value of this term. |
Term |
getTermAt(int index)
Returns the element at the specified index in this list. |
boolean |
isString()
Returns true if this term is an instance
of PBString (which can be used for fast string access) and
false otherwise. |
java.lang.String |
toString()
Returns a string description of this term. |
| Methods inherited from class se.sics.prologbeans.PBList |
getEnd, isList |
| 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, isVariable, longValue, stuffAtom |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public boolean isString()
Termtrue if this term is an instance
of PBString (which can be used for fast string access) and
false otherwise.isString in class Termpublic Term getArgument(int index)
Due to performance reasons this should be avoided if not 100%
necessary. Please use getCharAt(int index) or
getString() for accessing the value of strings.
getArgument in class PBListindex - the (one based) index of the argumentjava.lang.IllegalStateException - if this term is not compoundpublic int getArity()
TermgetArity in class PBListpublic java.lang.String getString()
public int getLength()
PBString.
Please note: this does not correspond to the prolog predicate length/1.
getLength in class PBListpublic Term getTermAt(int index)
Due to performance reasons this should be avoided if not 100%
necessary. Please use getCharAt(int index) or
getString() for accessing the value of strings.
getTermAt in class PBListindex - the (one based) index of the element in this listgetLength(),
getCharAt(int),
getString()public char getCharAt(int index)
index - the (one based) index of the character in this stringgetLength()public java.lang.String toString()
TermtoString in class PBList
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||