Package org.qdl_lang.util.aggregate
Class QDLAggregateUtil
- java.lang.Object
- 
- org.qdl_lang.util.aggregate.QDLAggregateUtil
 
- 
 public class QDLAggregateUtil extends Object The QDL utility for processing aggregates (stems and sets). This allows for processing each scalar in an aggregate and handles navigating them in turn. Implement or extends theProcessScalarinterface.Processing aggregates.You can do them so they follow the standard QDL stem/set contracts when implementing a system function by executing the correctAbstractEvaluator.processN in an evaluator or if you have something specific address each scalar using this utility. This utility in particular is useful when writing Java extensions that implementQDLFunctionwhere the machinery ofFunctionEvaluatoris not available.UsageIf you have an aggregate and need to process scalars, call this with the right overrides toIdentityScalarImpl. That class simply passes back its arguments unchanged as a default behavior.Handling exceptionsIf you use this in an extension (so a Java class that extendsQDLFunction) then you don't need to do anything special exception throw Java exceptions. If you are using this outside of that, then throws anUnknownTypeExceptionfor an unknown type. Since this does not have the actual QDL statement that triggered the error, it is set to null. You should catch the exception when calling this and fill that in with the right value so the user gets the right information.
- 
- 
Constructor SummaryConstructors Constructor Description QDLAggregateUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static QDLStemprocess(QDLStem stem, ProcessStemAxisRestriction processRankRestriction)Start processing for an axis restricted function.static Objectprocess(QDLValue qdlValue, ProcessScalar processScalar)Top-level call for this set of utilities.static QDLSetprocessSet(QDLSet<QDLValue> inSet, ProcessScalar processScalar)Process the elements in a set, including nested sets.static QDLStemprocessStem(QDLStem inStem, List<Object> index, ProcessScalar processScalar)static QDLStemprocessStem(QDLStem inStem, List index, ProcessStemAxisRestriction processRankRestriction, int currentDepth)
 
- 
- 
- 
Method Detail- 
processpublic static Object process(QDLValue qdlValue, ProcessScalar processScalar) Top-level call for this set of utilities. Create the right scalar processor, then call this on a generic object. A scalar is processed and returned as such, aggregates are processed as aggregates.- Parameters:
- qdlValue-
- processScalar- implementation of- ProcessScalar
- Returns:
 
 - 
processStempublic static QDLStem processStem(QDLStem inStem, List<Object> index, ProcessScalar processScalar) 
 - 
processSetpublic static QDLSet processSet(QDLSet<QDLValue> inSet, ProcessScalar processScalar) Process the elements in a set, including nested sets. This will access every element in every set eventually.- Parameters:
- inSet-
- processScalar-
- Returns:
 
 - 
processpublic static QDLStem process(QDLStem stem, ProcessStemAxisRestriction processRankRestriction) Start processing for an axis restricted function. This will throw an exception if the argument is not a stem.- Parameters:
- processRankRestriction-
- Returns:
 
 - 
processStempublic static QDLStem processStem(QDLStem inStem, List index, ProcessStemAxisRestriction processRankRestriction, int currentDepth) 
 
- 
 
-