se.sics.prologbeans
Class Bindings

Bindings handles the variable bindings in the communication with the prolog server. Using variable bindings ensures that the values are properly quoted when sent to the prolog server.

Constructor Summary
Bindings()
         Creates a new Bindings instance with no variable bindings.
Bindings(se.sics.prologbeans.Bindings binds)
         Creates a new Bindings instance and copies all existing variable bindings from the specified bindings.

Method Summary
se.sics.prologbeans.Bindings bind(string name, se.sics.prologbeans.Term bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bind(string name, string bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bind(string name, double bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bind(string name, float bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bind(string name, long bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bind(string name, int bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'.
se.sics.prologbeans.Bindings bindAtom(string name, string bvalue)
         Adds the specified variable binding. The variable name must start with an upper case letter or '_'. The value will be bound as an atom.
se.sics.prologbeans.Term getValue(string name)
         Returns the value for the specified variable or null if the variable is not bound.
string ToString()
        

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


Constructor Detail

Bindings

public Bindings()

Creates a new Bindings instance with no variable bindings.


Bindings

public Bindings(se.sics.prologbeans.Bindings binds)

Creates a new Bindings instance and copies all existing variable bindings from the specified bindings.

Parameters:
binds - the variable bindings to copy
Method Detail

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         se.sics.prologbeans.Term bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         string bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         double bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         float bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         long bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bind

public se.sics.prologbeans.Bindings bind(string name,
                                         int bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

bindAtom

public se.sics.prologbeans.Bindings bindAtom(string name,
                                             string bvalue)

Adds the specified variable binding. The variable name must start with an upper case letter or '_'. The value will be bound as an atom.

Parameters:
name - a prolog variable name
bvalue - the value to bind to the variable as an atom
Returns:
a reference to this Bindings object
Throws:
System.ArgumentException - if the name is not a valid prolog variable name

getValue

public se.sics.prologbeans.Term getValue(string name)

Returns the value for the specified variable or null if the variable is not bound.

Parameters:
name - the name of the variable
Returns:
the value of the variable as a Term or null if the variable is not bound

ToString

public string ToString()