pl.edu.pjwstk.yaod.yaql.engine
Class ActivationRecord

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.engine.ActivationRecord

public class ActivationRecord
extends java.lang.Object

The ActivationRecord class represents a section on the environmental stack. Each section consists of binders.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com
See Also:
EnvironmentalStack, BinderValue

Field Summary
 java.util.Vector binders
           
 
Constructor Summary
ActivationRecord()
          Creates a new empty activation record.
ActivationRecord(BinderValue binder)
          Creates a new activation record with specified binder.
 
Method Summary
 void addBinder(BinderValue binder)
          Adds a new binder to the actual activation record.
 void addBinder(java.lang.String name, QueryResult res)
          Adds a new binder (constructed from specified name and res) to the actual activation record.
 void addBinders(ActivationRecord ar)
          Adds a new binders (achieved from other activation record) to the actual activation record.
 boolean containsBinderHavingName(java.lang.String name)
          Tests whether or not the actual activation record possess the binder with the given name.
 void deleteBinder(BinderValue b)
          Deletes a specified binder (b) from activation record.
 QueryResult deleteBinderAt(int i)
          Deletes the i-th element from the activation record.
 BinderValue getBinderAt(int i)
          Returns the i-th element from the activation record.
 BagValue getBinderValuesHavingName(java.lang.String name)
          Returns a set (BagValue) of binder values whose name is equal to the name parameter.
 int getSize()
          Returns the number of binders in the activation record.
 void renameBinder(BinderValue b, java.lang.String name)
          Sets a specified binder (b) a new name (name).
 void show()
          Shows all the elements of activation record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

binders

public java.util.Vector binders
Constructor Detail

ActivationRecord

public ActivationRecord()
Creates a new empty activation record.

ActivationRecord

public ActivationRecord(BinderValue binder)
Creates a new activation record with specified binder.
Parameters:
binder - the binder to be put into activation record.
See Also:
BinderValue
Method Detail

getBinderAt

public BinderValue getBinderAt(int i)
Returns the i-th element from the activation record.
Parameters:
i - the index of element to be returned.
Returns:
the i-th element of activation record.
See Also:
BinderValue

getSize

public int getSize()
Returns the number of binders in the activation record.
Returns:
the number of binders in the activation record.

addBinder

public void addBinder(BinderValue binder)
Adds a new binder to the actual activation record.
Parameters:
binder - the binder to be added.
See Also:
BinderValue

addBinder

public void addBinder(java.lang.String name,
                      QueryResult res)
Adds a new binder (constructed from specified name and res) to the actual activation record.
Parameters:
name - the name of the binder to be added.
res - the value of the binder to be added.
See Also:
BinderValue

addBinders

public void addBinders(ActivationRecord ar)
Adds a new binders (achieved from other activation record) to the actual activation record.
Parameters:
ar - activation record whose binders will be added to the acutal activation record.

deleteBinderAt

public QueryResult deleteBinderAt(int i)
Deletes the i-th element from the activation record.
Parameters:
i - the index of binder to be deleted.
Returns:
the i-th binder of activation record.
See Also:
QueryResult

deleteBinder

public void deleteBinder(BinderValue b)
                  throws TypeMismatchException
Deletes a specified binder (b) from activation record.
Parameters:
b - binder which is to be deleted.
Throws:
TypeMismatchException - if comparison of elements fails.
See Also:
BinderValue

renameBinder

public void renameBinder(BinderValue b,
                         java.lang.String name)
                  throws TypeMismatchException
Sets a specified binder (b) a new name (name).
Parameters:
b - binder which name is to be changed.
name - a new name for the binder
Throws:
TypeMismatchException - if comparison of elements fails.
See Also:
BinderValue

containsBinderHavingName

public boolean containsBinderHavingName(java.lang.String name)
Tests whether or not the actual activation record possess the binder with the given name.
Parameters:
name - the name of the binders to be found.
Returns:
true if such binder exists, false otherwise.
See Also:
BinderValue

getBinderValuesHavingName

public BagValue getBinderValuesHavingName(java.lang.String name)
Returns a set (BagValue) of binder values whose name is equal to the name parameter.
Parameters:
name - the name of the binders to be found.
Returns:
a set of binder values.
See Also:
BagValue, BinderValue

show

public void show()
Shows all the elements of activation record.