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

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.QueryResult
        |
        +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.ComplexValue
              |
              +--pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.StructValue

public class StructValue
extends ComplexValue

The StructValue class represents the structure collections.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com

Fields inherited from class pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.ComplexValue
results
 
Constructor Summary
StructValue()
          Creates a new empty struct collection.
StructValue(QueryResult r)
          Creates a new struct collection initialized with the r.
StructValue(QueryResult r1, QueryResult r2)
          Creates a new bag collection initialized with the r1 and r2.
StructValue(java.util.Vector v)
          Creates a new struct collection initialized with the v.
 
Method Summary
 QueryResult getNextResultAt(int i)
          Method used during evaluation of non algebraic operators.
 int getNumberOfResults()
          Method used during evaluation of non algebraic operators.
 java.lang.String getTypeAsString()
          Returns a name of the result (QueryResult) type.
 ActivationRecord nested()
          Returns the sum of recursively called nested method for all structure elements.
 QueryResult operatorAS(QueryResult r)
          Method responsible for unary as operation.
 QueryResult operatorBAG()
          Method responsible for unary bag operation.
 QueryResult operatorCOMMA(QueryResult r)
          Method responsible for binary comma operation.
 BooleanValue operatorCOMPARE(QueryResult r)
          Method responsible for binary compare operation.
 IntegerValue operatorCOUNT()
          Method responsible for unary count operation.
 QueryResult operatorDESCENDING()
          Method responsible for unary descending operation.
 BooleanValue operatorINCLUSION(QueryResult r)
          Method responsible for binary inclusion operation.
 QueryResult operatorSEQUENCE()
          Method responsible for unary sequence operation.
 QueryResult operatorSTRUCT()
          Method responsible for unary struct operation.
 QueryResult operatorUNION(QueryResult r)
          Method responsible for binary union operation.
 QueryResult operatorUNIQUE()
          Method responsible for unary unique operation.
 
Methods inherited from class pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.ComplexValue
addBag, addResult, addSequence, addStruct, getFirstResult, getResultAt, getResults, getSize, isEmpty, operatorASCENDING, operatorAVERAGE, operatorCREATE, operatorCREATE, operatorCREATELOCAL, operatorCREATELOCAL, operatorCREATEPERMANENT, operatorCREATEPERMANENT, operatorDELETE, operatorDEREFERENCE, operatorEXISTS, operatorFULLDEREFERENCE, operatorGROUPAS, operatorINSERTINTO, operatorMAXIMUM, operatorMINIMUM, operatorMIXEDDEREFERENCE, operatorPRINT, operatorRENAMETO, operatorSPECIALDEREFERENCE, operatorSUM, operatorTOBAG, operatorTOSEQUENCE, operatorTOSINGLE, operatorTOSTRUCT, operatorUPDATETO, operatorXMLPRINT, setResultAt, show
 
Methods inherited from class pl.edu.pjwstk.yaod.yaql.engine.queryresulttypes.QueryResult
getLongestTypeAsSpacesString, getPreparedTypeAsString, operatorABSOLUTEVALUE, operatorASSIGN, operatorCONDITION, operatorCONJUNCTION, operatorCOSINE, operatorDIFFERENCE, operatorDISJUNCTION, operatorDIVIDE, operatorDIVIDEASSIGN, operatorEQUAL, operatorEXPONENT, operatorGREATER, operatorGREATEREQUAL, operatorINSERT, operatorINTERSECTION, operatorLOGARITHM, operatorLOWER, operatorLOWEREQUAL, operatorMINUS, operatorMINUS, operatorMINUSASSIGN, operatorMODULO, operatorMODULOASSIGN, operatorNEGATION, operatorNOTEQUAL, operatorPLUS, operatorPLUS, operatorPLUSASSIGN, operatorPOWER, operatorPREDECREMENT, operatorPREINCREMENT, operatorPRINT, operatorRANGE, operatorRANGE, operatorSIGNUM, operatorSINE, operatorSQUAREROOT, operatorSYMMETRICDIFFERENCE, operatorTIMES, operatorTIMESASSIGN, operatorTODOUBLE, operatorTOINTEGER, operatorTOSTRING, operatorXMLPRINT, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructValue

public StructValue()
Creates a new empty struct collection.

StructValue

public StructValue(java.util.Vector v)
Creates a new struct collection initialized with the v.
Parameters:
v - vector of elements.

StructValue

public StructValue(QueryResult r)
Creates a new struct collection initialized with the r.
Parameters:
r - any result.
See Also:
QueryResult

StructValue

public StructValue(QueryResult r1,
                   QueryResult r2)
Creates a new bag collection initialized with the r1 and r2.
Parameters:
r1 - any result.
r2 - any result.
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

nested

public ActivationRecord nested()
Returns the sum of recursively called nested method for all structure elements.
Overrides:
nested in class QueryResult
Returns:
the sum of recursively called nested method for all structure elements.
See Also:
ActivationRecord

getNumberOfResults

public int getNumberOfResults()
Method used during evaluation of non algebraic operators. It returns 1 for all single results (identifiers, binders and atomic values). The structure is treated as a single result!
Overrides:
getNumberOfResults in class ComplexValue
Returns:
1 always.

getNextResultAt

public QueryResult getNextResultAt(int i)
Method used during evaluation of non algebraic operators. It returns this for all single results, despite of the value of argument i. The structure is treated as a single result!
Overrides:
getNextResultAt in class ComplexValue
Parameters:
i - in single values it is ignored.
Returns:
this always.
See Also:
QueryResult

operatorCOUNT

public IntegerValue operatorCOUNT()
                           throws TypeMismatchException
Method responsible for unary count operation.
Overrides:
operatorCOUNT in class ComplexValue
Returns:
the result of the unary count operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
IntegerValue

operatorSTRUCT

public QueryResult operatorSTRUCT()
                           throws TypeMismatchException
Method responsible for unary struct operation.
Overrides:
operatorSTRUCT in class QueryResult
Returns:
the result of the unary struct operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult

operatorBAG

public QueryResult operatorBAG()
                        throws TypeMismatchException
Method responsible for unary bag operation.
Overrides:
operatorBAG in class QueryResult
Returns:
the result of the unary bag operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, BagValue

operatorSEQUENCE

public QueryResult operatorSEQUENCE()
                             throws TypeMismatchException
Method responsible for unary sequence operation.
Overrides:
operatorSEQUENCE in class QueryResult
Returns:
the result of the unary sequence operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, SequenceValue

operatorUNIQUE

public QueryResult operatorUNIQUE()
                           throws TypeMismatchException
Method responsible for unary unique operation.
Overrides:
operatorUNIQUE in class QueryResult
Returns:
the result of the unary unique operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult

operatorDESCENDING

public QueryResult operatorDESCENDING()
                               throws TypeMismatchException
Method responsible for unary descending operation.
Overrides:
operatorDESCENDING in class QueryResult
Returns:
the result of the unary descending operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult

operatorAS

public QueryResult operatorAS(QueryResult r)
                       throws TypeMismatchException
Method responsible for unary as operation.
Overrides:
operatorAS in class QueryResult
Parameters:
r - the right operand of the unary as operator.
Returns:
the result of the unary as operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, BinderValue, StringValue

operatorCOMMA

public QueryResult operatorCOMMA(QueryResult r)
                          throws TypeMismatchException
Method responsible for binary comma operation.
Overrides:
operatorCOMMA in class QueryResult
Parameters:
r - the right operand of the binary comma operator.
Returns:
the result of the binary comma operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, SequenceValue, SingleValue, BagValue

operatorUNION

public QueryResult operatorUNION(QueryResult r)
                          throws TypeMismatchException
Method responsible for binary union operation.
Overrides:
operatorUNION in class QueryResult
Parameters:
r - the right operand of the binary union operator.
Returns:
the result of the binary union operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, SequenceValue, SingleValue, BagValue

operatorCOMPARE

public BooleanValue operatorCOMPARE(QueryResult r)
                             throws TypeMismatchException
Method responsible for binary compare operation.
Overrides:
operatorCOMPARE in class QueryResult
Parameters:
r - the right operand of the binary compare operator.
Returns:
the result of the binary compare operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, BooleanValue

operatorINCLUSION

public BooleanValue operatorINCLUSION(QueryResult r)
                               throws TypeMismatchException
Method responsible for binary inclusion operation.
Overrides:
operatorINCLUSION in class QueryResult
Parameters:
r - the right operand of the binary inclusion operator.
Returns:
the result of the binary inclusion operation.
Throws:
TypeMismatchException - if type mismatch occurs.
See Also:
QueryResult, SequenceValue, BooleanValue, BagValue, ComplexValue