|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectse.sics.prologbeans.PBTerm
public abstract class PBTerm
PBTerm is the Java representations
of Prolog terms.
| Field Summary | |
|---|---|
protected java.lang.String |
name
|
static PBTerm |
NIL
The PBTerm NIL, with the
printname "[]", represents the empty list. |
| Method Summary | |
|---|---|
java.math.BigInteger |
bigIntegerValue()
Returns the BigInteger value of this
PBTerm. |
double |
floatValue()
Returns the floating-point value of this PBTerm. |
PBTerm |
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 PBTerm is not a compound term. |
java.lang.String |
getName()
Returns the name of this constant or compound term. |
java.lang.String |
getString()
If this PBTerm is a proper list and all its
elements are small integers (less than 256), returns a
String with the list elements as the character
codes of the String. |
PBTerm |
head()
Returns the head of this PBTerm if it is a
list cell, i.e. a compound term with the functor ./2. |
long |
intValue()
Returns the integer value of this PBTerm. |
boolean |
isAtom()
Returns true if this PBTerm is
an atom and false otherwise. |
boolean |
isAtomic()
Returns true if this PBTerm is a
constant (e.g. integer, floating-point number, or atom) and
false if this PBTerm is a
compound term or variable. |
boolean |
isBignum()
Returns true if this PBTerm is
an bignum integer and false otherwise. |
boolean |
isCompound()
Returns true if this PBTerm is a
compund term and false otherwise. |
boolean |
isEmptyList()
Returns true if this PBTerm is
the empty list and false otherwise. |
boolean |
isFloat()
Returns true if this PBTerm is a
floating-point number and false otherwise. |
boolean |
isInteger()
Returns true if this PBTerm is
an integer and false otherwise. |
boolean |
isListCell()
Returns true if this PBTerm is a
list cell, i.e. a compound term with the functor ./2, and
false otherwise. |
boolean |
isNumber()
Returns true if this PBTerm is a
number and false otherwise. |
boolean |
isProperList()
Returns true if this PBTerm is a
proper list and false otherwise. |
boolean |
isString()
Returns true if this PBTerm is a
proper list and all of its elements are character codes or one character
atoms. |
boolean |
isVariable()
Returns true if this PBTerm is a
variable and false otherwise. |
int |
length()
If this PBTerm is a proper list, returns its
length. |
static PBTerm |
makeAtom(java.lang.String value)
Creates a new PBTerm instance representing an
atom. |
static PBTerm |
makeTerm(java.math.BigInteger value)
Creates a new PBTerm instance representing a
BigInteger value. |
static PBTerm |
makeTerm(double value)
Creates a new PBTerm instance representing a
double value. |
static PBTerm |
makeTerm(float value)
Creates a new PBTerm instance representing a
float value. |
static PBTerm |
makeTerm(int value)
Creates a new PBTerm instance representing an
int value. |
static PBTerm |
makeTerm(long value)
Creates a new PBTerm instance representing a
long value. |
static PBTerm |
makeTerm(PBTerm head,
PBTerm tail)
Creates a new PBTerm instance representing a
list cell. |
static PBTerm |
makeTerm(java.lang.String value)
Creates a new PBTerm instance representing a
list with the characters, as integer values, in the string argument as
its elements. |
static PBTerm |
makeTerm(java.lang.String name,
PBTerm[] arguments)
Creates a new PBTerm instance representing a
compound term. |
protected java.lang.String |
stuffAtom(java.lang.String atom)
|
PBTerm |
tail()
Returns the tail of this PBTerm if it is a
list cell, i.e. a compound term with the functor ./2. |
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 |
|---|
public static final PBTerm NIL
PBTerm NIL, with the
printname "[]", represents the empty list.
protected final java.lang.String name
| Method Detail |
|---|
public boolean isAtom()
true if this PBTerm is
an atom and false otherwise.
public boolean isAtomic()
true if this PBTerm is a
constant (e.g. integer, floating-point number, or atom) and
false if this PBTerm is a
compound term or variable.
public boolean isNumber()
true if this PBTerm is a
number and false otherwise.
public boolean isInteger()
true if this PBTerm is
an integer and false otherwise.
public boolean isBignum()
true if this PBTerm is
an bignum integer and false otherwise.
public boolean isFloat()
true if this PBTerm is a
floating-point number and false otherwise.
public boolean isCompound()
true if this PBTerm is a
compund term and false otherwise.
public boolean isListCell()
true if this PBTerm is a
list cell, i.e. a compound term with the functor ./2, and
false otherwise.
public boolean isProperList()
true if this PBTerm is a
proper list and false otherwise.
public boolean isEmptyList()
true if this PBTerm is
the empty list and false otherwise.
public boolean isString()
true if this PBTerm is a
proper list and all of its elements are character codes or one character
atoms. Returns false otherwise.
public PBTerm head()
PBTerm if it is a
list cell, i.e. a compound term with the functor ./2.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a list cell.public PBTerm tail()
PBTerm if it is a
list cell, i.e. a compound term with the functor ./2.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a list cell.public boolean isVariable()
true if this PBTerm is a
variable and false otherwise.
public java.lang.String getName()
public PBTerm getArgument(int index)
index - the (one based) index of the argument
PBTerm
{@if.java - java.lang. }IllegalStateException if this term is not
compoundpublic int length()
PBTerm is a proper list, returns its
length.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a proper list.public int getArity()
PBTerm is not a compound term.
public long intValue()
PBTerm.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not an integer.public java.math.BigInteger bigIntegerValue()
BigInteger value of this
PBTerm.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a bignum integer.BigIntegerpublic double floatValue()
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a number.public java.lang.String getString()
PBTerm is a proper list and all its
elements are small integers (less than 256), returns a
String with the list elements as the character
codes of the String.
{@if.java - java.lang. }IllegalStateException if this
PBTerm is not a proper list.public abstract java.lang.String toString()
toString in class java.lang.Objectpublic static PBTerm makeTerm(float value)
PBTerm instance representing a
float value.
public static PBTerm makeTerm(double value)
PBTerm instance representing a
double value.
public static PBTerm makeTerm(int value)
PBTerm instance representing an
int value.
public static PBTerm makeTerm(long value)
PBTerm instance representing a
long value.
public static PBTerm makeTerm(java.math.BigInteger value)
PBTerm instance representing a
BigInteger value.
public static PBTerm makeTerm(java.lang.String value)
PBTerm instance representing a
list with the characters, as integer values, in the string argument as
its elements.
public static PBTerm makeTerm(java.lang.String name,
PBTerm[] arguments)
PBTerm instance representing a
compound term.
public static PBTerm makeTerm(PBTerm head,
PBTerm tail)
PBTerm instance representing a
list cell.
public static PBTerm makeAtom(java.lang.String value)
PBTerm instance representing an
atom.
protected java.lang.String stuffAtom(java.lang.String atom)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||