|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--se.sics.prologbeans.Term
Term
is the base for Java representations of Prolog terms.
Field Summary | |
protected java.lang.String |
name
|
Method Summary | |
double |
doubleValue()
Returns the floating-point value of this term. |
float |
floatValue()
Returns the floating-point value of this term. |
Term |
getArgument(int index)
Returns the argument at the specified index. |
int |
getArity()
Returns the number of arguments of this compound term or 0 if this term is not a compound term. |
java.lang.String |
getName()
Returns the name of this constant or compound term. |
int |
intValue()
Returns the integer value of this term. |
boolean |
isAtom()
Returns true if this term is an atom and
false otherwise. |
boolean |
isAtomic()
Returns true if this term is a constant
(e.g. |
boolean |
isCompound()
Returns true if this term is a compund term and
false otherwise. |
boolean |
isFloat()
Returns true if this term is a floating-point number
and false otherwise. |
boolean |
isInteger()
Returns true if this term is an integer and
false otherwise. |
boolean |
isList()
Returns true if this term is a list and
false otherwise. |
boolean |
isString()
Returns true if this term is an instance
of PBString (which can be used for fast string access) and
false otherwise. |
boolean |
isVariable()
Returns true if this term is a variable and
false otherwise. |
long |
longValue()
Returns the integer value of this term. |
protected java.lang.String |
stuffAtom(java.lang.String atom)
|
abstract java.lang.String |
toString()
Returns a string description of this term. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final java.lang.String name
Method Detail |
public boolean isAtom()
true
if this term is an atom and
false
otherwise.public boolean isInteger()
true
if this term is an integer and
false
otherwise.public boolean isFloat()
true
if this term is a floating-point number
and false
otherwise.public boolean isCompound()
true
if this term is a compund term and
false
otherwise.public boolean isList()
true
if this term is a list and
false
otherwise.public boolean isString()
true
if this term is an instance
of PBString
(which can be used for fast string access) and
false
otherwise.public boolean isAtomic()
true
if this term is a constant
(e.g. integer, floating-point number, or atom) and
false
if this term is a compound term or variable.public boolean isVariable()
true
if this term is a variable and
false
otherwise.public java.lang.String getName()
public Term getArgument(int index)
index
- the (one based) index of the argumentjava.lang.IllegalStateException
- if this term is not compoundpublic int getArity()
public int intValue()
java.lang.IllegalStateException
- if this term is not an integerpublic long longValue()
java.lang.IllegalStateException
- if this term is not an integerpublic float floatValue()
java.lang.IllegalStateException
- if this term is not a numberpublic double doubleValue()
java.lang.IllegalStateException
- if this term is not a numberpublic abstract java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String stuffAtom(java.lang.String atom)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |