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(Bindings binds)
Creates a new Bindings instance and copies all existing
variable bindings from the specified bindings. |
Method Summary | |
---|---|
public Bindings |
bind(string name, int intvalue)
Adds the specified variable binding. |
public Bindings |
bind(string name, long longvalue)
Adds the specified variable binding. |
public Bindings |
bind(string name, float floatvalue)
Adds the specified variable binding. |
public Bindings |
bind(string name, double doublevalue)
Adds the specified variable binding. |
public Bindings |
bind(string name, string stringvalue)
Adds the specified variable binding. |
public Bindings |
bind(string name, PBTerm termvalue)
Adds the specified variable binding. |
public Bindings |
bindAtom(string name, string atomvalue)
Adds the specified variable binding. |
public PBTerm |
getValue(string name)
Returns the value for the specified variable or null
if the variable is not bound. |
public string |
toString()
|
Constructor Detail |
---|
Bindings()
Bindings
instance with no variable bindings.
Bindings(Bindings binds)
Bindings
instance and copies all existing
variable bindings from the specified bindings.
binds
- the variable bindings to copyMethod Detail |
---|
public Bindings bind(string name, int intvalue)
name
- a prolog variable nameintvalue
- the value to bind to the variableBindings
objectpublic Bindings bind(string name, long longvalue)
name
- a prolog variable namelongvalue
- the value to bind to the variableBindings
objectpublic Bindings bind(string name, float floatvalue)
name
- a prolog variable namefloatvalue
- the value to bind to the variableBindings
objectpublic Bindings bind(string name, double doublevalue)
name
- a prolog variable namedoublevalue
- the value to bind to the variableBindings
objectpublic Bindings bind(string name, string stringvalue)
name
- a prolog variable namestringvalue
- the value to bind to the variableBindings
objectpublic Bindings bind(string name, PBTerm termvalue)
name
- a prolog variable nametermvalue
- the value to bind to the variableBindings
objectpublic Bindings bindAtom(string name, string atomvalue)
name
- a prolog variable nameatomvalue
- the value to bind to the variable as an atomBindings
objectpublic PBTerm getValue(string name)
null
if the variable is not bound.
name
- the name of the variableTerm
or
null
if the variable is not boundpublic string toString()