pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes
Class BinderValue

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.QueryResult
        |
        +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.SingleValue
              |
              +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.BinderValue

public class BinderValue
extends SingleValue

The BinderValue class represents a single binder, which is a pair (name, result). Such binder is a basic element which can be hold on environmental stack in its sections (activation records).

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

Constructor Summary
BinderValue(java.lang.String name, QueryResult value)
          Creates a new binder with specified name and value.
 
Method Summary
 java.lang.String getName()
          Returns the name of the binder.
 java.lang.String getTypeAsString()
          Returns a name of the result (QueryResult) type.
 QueryResult getValue()
          Returns the value of the binder.
 ActivationRecord nested()
          The result of nested function, as specified in Stack Based Approach by K.
 BooleanValue operatorCOMPARE(QueryResult r)
          Returns a the result of comparing this binder with the result.
 QueryResult operatorCREATE(IdentifierValue id)
          Creates a new object in data store, which structure corresponds to the structure this binder.
 QueryResult operatorCREATELOCAL(IdentifierValue id)
          Creates a new local object in data store, which structure corresponds to the structure this binder.
 QueryResult operatorCREATEPERMANENT(IdentifierValue id)
          Creates a new permanent object in data store, which structure corresponds to the structure this binder.
 QueryResult operatorDEREFERENCE()
          Returns a the result of dereference operation on binder result, which is this binder itself.
 QueryResult operatorFULLDEREFERENCE()
          Return a the result of full dereference operation on binder result, which is this binder containing recursively dereferenced value.
 QueryResult operatorMIXEDDEREFERENCE()
          Returns a the result of mixed dereference operation on binder result, which is this binder contained recursively dereferenced value.
 void operatorPRINT(java.lang.String st, java.io.PrintWriter out)
          Prints the actual binder in the normal fashion.
 QueryResult operatorSPECIALDEREFERENCE()
          Returns a the result of special dereference operation on binder result, which is this binder containing recursively dereferenced value.
 void operatorXMLPRINT(java.lang.String st, java.io.PrintWriter out)
          Prints the actual binder in the XML fasion.
 void setName(java.lang.String name)
          Sets the new name of the binder.
 QueryResult setValue(QueryResult value)
          Sets the new value of the binder.
 void show(java.lang.String st, java.io.PrintWriter out)
          Prints the actual binder in the raw fasion.
 
Methods inherited from class pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.SingleValue
getNextResultAt, getNumberOfResults, operatorAS, operatorASCENDING, operatorBAG, operatorCOMMA, operatorCOUNT, operatorEXISTS, operatorGROUPAS, operatorINCLUSION, operatorSEQUENCE, operatorSTRUCT, operatorTOSINGLE, operatorUNION, operatorUNIQUE
 
Methods inherited from class pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.QueryResult
getLongestTypeAsSpacesString, getPreparedTypeAsString, operatorABSOLUTEVALUE, operatorASSIGN, operatorAVERAGE, operatorCONDITION, operatorCONJUNCTION, operatorCOSINE, operatorCREATE, operatorCREATELOCAL, operatorCREATEPERMANENT, operatorDELETE, operatorDESCENDING, operatorDIFFERENCE, operatorDISJUNCTION, operatorDIVIDE, operatorDIVIDEASSIGN, operatorEQUAL, operatorEXPONENT, operatorGREATER, operatorGREATEREQUAL, operatorINSERT, operatorINSERTINTO, operatorINTERSECTION, operatorLOGARITHM, operatorLOWER, operatorLOWEREQUAL, operatorMAXIMUM, operatorMINIMUM, operatorMINUS, operatorMINUS, operatorMINUSASSIGN, operatorMODULO, operatorMODULOASSIGN, operatorNEGATION, operatorNOTEQUAL, operatorPLUS, operatorPLUS, operatorPLUSASSIGN, operatorPOWER, operatorPREDECREMENT, operatorPREINCREMENT, operatorPRINT, operatorRANGE, operatorRANGE, operatorRENAMETO, operatorSIGNUM, operatorSINE, operatorSQUAREROOT, operatorSUM, operatorSYMMETRICDIFFERENCE, operatorTIMES, operatorTIMESASSIGN, operatorTOBAG, operatorTODOUBLE, operatorTOINTEGER, operatorTOSEQUENCE, operatorTOSTRING, operatorTOSTRUCT, operatorUPDATETO, operatorXMLPRINT, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinderValue

public BinderValue(java.lang.String name,
                   QueryResult value)
Creates a new binder with specified name and value.
Parameters:
name - the name of the binder.
value - the value of the binder.
See Also:
QueryResult
Method Detail

getTypeAsString

public java.lang.String getTypeAsString()
Returns a name of the result (QueryResult) type.
Overrides:
getTypeAsString in class QueryResult
Returns:
a binder type name.
See Also:
QueryResult

getName

public java.lang.String getName()
Returns the name of the binder.
Returns:
the name of the binder.

setName

public void setName(java.lang.String name)
Sets the new name of the binder.
Parameters:
name - the new name of the binder.

getValue

public QueryResult getValue()
Returns the value of the binder.
Returns:
the value of the binder.

setValue

public QueryResult setValue(QueryResult value)
Sets the new value of the binder. Additionally returns the acutal binder.
Parameters:
value - the new value of the binder.
Returns:
this binder.

nested

public ActivationRecord nested()
The result of nested function, as specified in Stack Based Approach by K. Subieta, is a new activation record containing this binder.
Overrides:
nested in class QueryResult
Returns:
this binder.
See Also:
ActivationRecord

operatorDEREFERENCE

public QueryResult operatorDEREFERENCE()
                                throws TypeMismatchException
Returns a the result of dereference operation on binder result, which is this binder itself.
Overrides:
operatorDEREFERENCE in class QueryResult
Returns:
this binder.
Throws:
TypeMismatchException - never in this case.

operatorFULLDEREFERENCE

public QueryResult operatorFULLDEREFERENCE()
                                    throws TypeMismatchException
Return a the result of full dereference operation on binder result, which is this binder containing recursively dereferenced value.
Overrides:
operatorFULLDEREFERENCE in class QueryResult
Returns:
this binder.
Throws:
TypeMismatchException - never in this case.

operatorSPECIALDEREFERENCE

public QueryResult operatorSPECIALDEREFERENCE()
                                       throws TypeMismatchException
Returns a the result of special dereference operation on binder result, which is this binder containing recursively dereferenced value.
Overrides:
operatorSPECIALDEREFERENCE in class QueryResult
Returns:
this binder.
Throws:
TypeMismatchException - - never in this case.

operatorMIXEDDEREFERENCE

public QueryResult operatorMIXEDDEREFERENCE()
                                     throws TypeMismatchException
Returns a the result of mixed dereference operation on binder result, which is this binder contained recursively dereferenced value.
Overrides:
operatorMIXEDDEREFERENCE in class QueryResult
Returns:
this binder.
Throws:
TypeMismatchException - never in this case.

operatorCOMPARE

public BooleanValue operatorCOMPARE(QueryResult r)
                             throws TypeMismatchException
Returns a the result of comparing this binder with the result.
Overrides:
operatorCOMPARE in class QueryResult
Parameters:
r - the object to be compare with.
Returns:
this binder.
Throws:
TypeMismatchException - never in this case.
See Also:
BooleanValue, QueryResult

show

public void show(java.lang.String st,
                 java.io.PrintWriter out)
Prints the actual binder in the raw fasion. The result is printed on out object.
Overrides:
show in class QueryResult
Parameters:
st - the string which is an auxiliary tabulator.
out - the object responsible for displaying information.
Throws:
TypeMismatchException - never in this case.

operatorPRINT

public void operatorPRINT(java.lang.String st,
                          java.io.PrintWriter out)
                   throws TypeMismatchException
Prints the actual binder in the normal fashion. The result is printed on out object.
Overrides:
operatorPRINT in class QueryResult
Parameters:
st - the string which is an auxiliary tabulator.
out - the object responsible for displaying information.
Throws:
TypeMismatchException - never in this case.

operatorXMLPRINT

public void operatorXMLPRINT(java.lang.String st,
                             java.io.PrintWriter out)
                      throws TypeMismatchException
Prints the actual binder in the XML fasion. The result is printed on out object.
Overrides:
operatorXMLPRINT in class QueryResult
Parameters:
st - the string which is an auxiliary tabulator.
out - the object responsible for displaying information.
Throws:
TypeMismatchException - never in this case.

operatorCREATE

public QueryResult operatorCREATE(IdentifierValue id)
                           throws TypeMismatchException
Creates a new object in data store, which structure corresponds to the structure this binder. Additionally it returns the identifier of a newly created object. It works the same as operatorCREATELOCAL.
Overrides:
operatorCREATE in class QueryResult
Parameters:
id - Identifier of the parent object in object store.
Returns:
identifier of the created object.
Throws:
TypeMismatchException - if the structure of binder is not valid.

operatorCREATELOCAL

public QueryResult operatorCREATELOCAL(IdentifierValue id)
                                throws TypeMismatchException
Creates a new local object in data store, which structure corresponds to the structure this binder. Additionally it returns the identifier of a newly created object.
Overrides:
operatorCREATELOCAL in class QueryResult
Parameters:
id - Identifier of the parent object in object store.
Returns:
identifier of the created object.
Throws:
TypeMismatchException - if the structure of binder is not valid.

operatorCREATEPERMANENT

public QueryResult operatorCREATEPERMANENT(IdentifierValue id)
                                    throws TypeMismatchException
Creates a new permanent object in data store, which structure corresponds to the structure this binder. Additionally it returns the identifier of a newly created object.
Overrides:
operatorCREATEPERMANENT in class QueryResult
Parameters:
id - Identifier of the parent object in object store.
Returns:
identifier of the created object.
Throws:
TypeMismatchException - if the structure of binder is not valid.