se.sics.prologbeans
Class Term

Term is the base for .NET representations of Prolog terms.

Field Summary
string name
        

Property Summary
int Arity
         Returns the number of arguments of this compound term or 0 if this term is not a compound term.
bool Atom
         Returns true if this term is an atom and false otherwise.
bool Atomic
         Returns 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.
bool Compound
         Returns true if this term is a compund term and false otherwise.
bool Float
         Returns true if this term is a floating-point number and false otherwise.
bool Integer
         Returns true if this term is an integer and false otherwise.
bool IsString
         Returns true if this term is an instance of PBString (which can be used for fast string access) and false otherwise.
bool List
         Returns true if this term is a list and false otherwise.
string Name
         Returns the name of this constant or compound term.
bool Variable
         Returns true if this term is a variable and false otherwise.

Method Summary
double doubleValue()
         Returns the floating-point value of this term. if this term is not a number
float floatValue()
         Returns the floating-point value of this term. if this term is not a number
se.sics.prologbeans.Term getArgument(int index)
         Returns the argument at the specified index. Only compound terms have arguments. Note: the arguments are indexed from 1 to arity.
int intValue()
         Returns the integer value of this term. if this term is not an integer
long longValue()
         Returns the integer value of this term. if this term is not an integer
string stuffAtom(string atom)
        
string ToString()
         Returns a string description of this term.

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone


Field Detail

name

protected internal string name

Property Detail

Arity

public int Arity

Returns the number of arguments of this compound term or 0 if this term is not a compound term.


Atom

public bool Atom

Returns true if this term is an atom and false otherwise.


Atomic

public bool Atomic

Returns 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.


Compound

public bool Compound

Returns true if this term is a compund term and false otherwise.


Float

public bool Float

Returns true if this term is a floating-point number and false otherwise.


Integer

public bool Integer

Returns true if this term is an integer and false otherwise.


IsString

public bool IsString

Returns true if this term is an instance of PBString (which can be used for fast string access) and false otherwise.


List

public bool List

Returns true if this term is a list and false otherwise.


Name

public string Name

Returns the name of this constant or compound term.


Variable

public bool Variable

Returns true if this term is a variable and false otherwise.

Method Detail

doubleValue

public double doubleValue()

Returns the floating-point value of this term. if this term is not a number


floatValue

public float floatValue()

Returns the floating-point value of this term. if this term is not a number


getArgument

public se.sics.prologbeans.Term getArgument(int index)

Returns the argument at the specified index. Only compound terms have arguments. Note: the arguments are indexed from 1 to arity.

Parameters:
index - the (one based) index of the argument
Returns:
the argument as a Term
Throws:
System.SystemException - if this term is not compound

intValue

public int intValue()

Returns the integer value of this term. if this term is not an integer


longValue

public long longValue()

Returns the integer value of this term. if this term is not an integer


stuffAtom

protected internal string stuffAtom(string atom)


ToString

public string ToString()

Returns a string description of this term.