eRqlEngine API documentation - http://www.wleklinski.de/rdf/

eworks.RQL.engine
Class SymbolTable

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byeworks.RQL.engine.SymbolTable
All Implemented Interfaces:
Cloneable, Map, Serializable

public class SymbolTable
extends Hashtable

A symbol table that is used by RqlEngine class for storing the values of variables.

Version:
1.00 (2003-11-03)
Author:
Fabian Wleklinski (fabian@wleklinski.de)
See Also:
RqlEngine, Serialized Form

Constructor Summary
SymbolTable()
          Creates a new and empty symbol table using the default capacity.
SymbolTable(int initialCapacity)
          Creates a new and empty symbol table with the given intial capacity.
 
Method Summary
 void bind(Variable variable, LiteralValue value)
          Binds the variable variable to the value value.
 LiteralValue get(String name)
          Returns the value of the variable specified by name.
 Tuple getTuple()
          Returns all bound variables and their values as tuple, using an instance of Tuple.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymbolTable

public SymbolTable()
Creates a new and empty symbol table using the default capacity.


SymbolTable

public SymbolTable(int initialCapacity)
Creates a new and empty symbol table with the given intial capacity.

Parameters:
initialCapacity - The symbol table's initial capicity
Method Detail

get

public LiteralValue get(String name)
                 throws VariableNotBoundException
Returns the value of the variable specified by name.

Parameters:
name - The variable's name
Returns:
The variable's value
Throws:
VariableNotBoundException - Thrown if there is no bound variable named name

getTuple

public Tuple getTuple()
Returns all bound variables and their values as tuple, using an instance of Tuple.

Returns:
A tuple built by all contained variables and their values.

bind

public void bind(Variable variable,
                 LiteralValue value)
          throws VariableAlreadyBoundException
Binds the variable variable to the value value.

Parameters:
variable - The variable to be bound.
value - The value to be bound.
Throws:
VariableAlreadyBoundException - is thrown if the variable variable is already bound.

eRqlEngine API documentation - http://www.wleklinski.de/rdf/