***  This class is subject to change.  ***

com.sas.iquery.dataservices
Class DataRetrievalUtil

com.sas.iquery.dataservices.DataRetrievalUtil

public class DataRetrievalUtil

Utility methods for extracting information from data selections.


Constructor Summary
DataRetrievalUtil()
           
 
Method Summary
static boolean hasSummarizeableItems(BusinessQuery bq)
          Determines if the business query contains data items which may be summarized.
static boolean hasSummarizeableItems(DataSelection ds)
          Determines if the business query contains data items which may be summarized.
static boolean hasValidROLAPAggregation(DataItem item)
          Tests if a given data item has an aggregation function which may be used in ROLAP.
static boolean isItemToSummarize(DataItem item)
          Determines whether a data item should be used in relational totals.
static boolean isModelDetailed(DataSelection dataSelection)
          Returns true if the data selection will return detailed (unaggregated) data
static boolean isModelGrandTotal(DataSelection dataSelection)
          Check if the model is GrandTotal.
static boolean isModelRanked(DataSelection model)
          Checks if a data selection contains a rank filter.
static boolean isModelROLAP(DataSelection dataSelection)
          Checks if the given data selection is ROLAP.
static boolean isNonAdditiveMeasure(DataItem resultItem)
          Returns true if the item is a non-additive measure
static boolean isSummarizableItem(DataItem item)
          Determines whether a data item should be used in relational totals.
static boolean isValidROLAPAggregation(DataItem item, Function aggregation)
          Tests if a given data item can be used with the given aggregation function in ROLAP.
static boolean isValidROLAPAggregation(Function aggregation)
          Tests if a given function may be used as an aggregation for ROLAP.
static boolean isValidROLAPAggregation(FunctionNameID functionNameID)
          Tests if the function with the given name may be used as an aggregation for ROLAP.
 

Constructor Detail

DataRetrievalUtil

public DataRetrievalUtil()
Method Detail

hasSummarizeableItems

public static boolean hasSummarizeableItems(DataSelection ds)
                                     throws GenerationException
Determines if the business query contains data items which may be summarized. Obsoleted by the more generic hasSummarizeableItems(BusinessQuery)

Returns:
true if there are summarizeable items in the DataSelection
Throws:
GenerationException
See Also:
hasSummarizeableItems(BusinessQuery)

hasSummarizeableItems

public static boolean hasSummarizeableItems(BusinessQuery bq)
                                     throws java.lang.IllegalArgumentException
Determines if the business query contains data items which may be summarized.

Returns:
true if there are summarizeable items in the given business query
Throws:
java.lang.IllegalArgumentException

isItemToSummarize

public static boolean isItemToSummarize(DataItem item)
                                 throws java.lang.IllegalArgumentException
Determines whether a data item should be used in relational totals. In order for a total value to appear for the data item, it must be numeric. Therefore, detail DataItems with Count will not appear.

Parameters:
item - The data item to check
Returns:
true if the specified item will be summarized
Throws:
java.lang.IllegalArgumentException - If the item's total expression is not valid

isSummarizableItem

public static boolean isSummarizableItem(DataItem item)
                                  throws GenerationException
Determines whether a data item should be used in relational totals. In order for a total value to appear for the data item, it must be numeric. Therefore, detail DataItems with Count will not appear.

Parameters:
item - The data item to check
Returns:
true if the specified item will be summarized
Throws:
GenerationException - If the item's total expression is not valid

hasValidROLAPAggregation

public static boolean hasValidROLAPAggregation(DataItem item)
Tests if a given data item has an aggregation function which may be used in ROLAP.

Parameters:
item -
Returns:
true if the specified item's aggregation is supported by ROLAP.

isValidROLAPAggregation

public static boolean isValidROLAPAggregation(DataItem item,
                                              Function aggregation)
Tests if a given data item can be used with the given aggregation function in ROLAP.

Parameters:
item -
aggregation -
Returns:
true if the specified item and aggregation pair are supported by ROLAP.

isValidROLAPAggregation

public static boolean isValidROLAPAggregation(Function aggregation)
Tests if a given function may be used as an aggregation for ROLAP. To test a data item, use hasValidROLAPAggregation(DataItem)

Returns:
true if the specified aggregation is supported by ROLAP.

isValidROLAPAggregation

public static boolean isValidROLAPAggregation(FunctionNameID functionNameID)
Tests if the function with the given name may be used as an aggregation for ROLAP.

Returns:
true if the specified aggregation is supported by ROLAP.

isModelROLAP

public static boolean isModelROLAP(DataSelection dataSelection)
                            throws GenerationException
Checks if the given data selection is ROLAP. A data selection is ROLAP if any of its result items have the roles of Role.ROW.

Parameters:
dataSelection - The data selection to test
Returns:
true if the given data selection is ROLAP
Throws:
GenerationException

isModelGrandTotal

public static boolean isModelGrandTotal(DataSelection dataSelection)
                                 throws GenerationException
Check if the model is GrandTotal. This contains the isGrandTotal(DataSelection) check, but also ensures that all visible result items have isGrandRole(Role).

Parameters:
dataSelection - The data selection to check
Returns:
true If the model meets all criteria for being grand total
Throws:
GenerationException

isModelRanked

public static boolean isModelRanked(DataSelection model)
Checks if a data selection contains a rank filter.

Parameters:
model - The data selection to check
Returns:
true If the data selection is ranked.

isNonAdditiveMeasure

public static boolean isNonAdditiveMeasure(DataItem resultItem)
Returns true if the item is a non-additive measure

Parameters:
resultItem -
Returns:

isModelDetailed

public static boolean isModelDetailed(DataSelection dataSelection)
Returns true if the data selection will return detailed (unaggregated) data

Parameters:
dataSelection -
Returns:

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.