com.sas.dataselectors.calculateditems
Class BaseCalculatedItemAdapter

com.sas.dataselectors.calculateditems.BaseCalculatedItemAdapter
All Implemented Interfaces:
CalculatedItemInterface, CalculatedItemMetadataInterface, CalculatedItemV2Interface
Direct Known Subclasses:
BusinessModelToCalculatedItemAdapter, BusinessQueryToCalculatedItemAdapter, DataSelectionToCalculatedItemAdapter

public abstract class BaseCalculatedItemAdapter
implements CalculatedItemV2Interface

Description: This is the base adapter for going from a CalculatedObjectFactoryInterface to a CalculatedItemInterface. The super implementation should mint a CalculatedObjectFactoryInterface as needed. If no businessObject is provided at construction then a new and empty CalculatedItem is used. Copyright: Copyright (c) 2002 Company: SAS


Field Summary
protected  java.lang.String basePeriod
           
protected  java.lang.Object businessModelObject
          The object that the factory has provided for persistance
protected  java.lang.String description
          The description of this calculated item.
static java.lang.String ERROR_INVALIDEXPR
           
protected  java.lang.String expression
          The expression representing this calculated item.
protected  int expressionType
          The type of the expression representing this calculated item.
protected  java.lang.String format
          The format for this calculated item
protected  java.lang.String function
           
protected  java.lang.String id
          The id of this calculated item.
protected  boolean isTimeBasedItem
           
protected  java.lang.String label
          The label (human readable name) of this calculated item.
protected  java.lang.Object measureExpression
           
protected  CalculatedObjectFactoryInterface objectFactory
          The factory for getting objects and metadata
static java.lang.String RB_KEY
           
protected  com.sas.iquery.metadata.expr.ExpressionInterface timeExpressionMeasure
           
protected  boolean validateCalculationEnabled
          True of the calculation is to be validated as part of validate()
 
Fields inherited from interface com.sas.dataselectors.calculateditems.CalculatedItemInterface
CALCITEM_TYPE_BITSTRING, CALCITEM_TYPE_BOOLEAN, CALCITEM_TYPE_CHARACTER, CALCITEM_TYPE_DATE, CALCITEM_TYPE_INTERVAL_DT, CALCITEM_TYPE_INTERVAL_YM, CALCITEM_TYPE_NOT_SET, CALCITEM_TYPE_NUMERIC, CALCITEM_TYPE_OLAP_CATEGORY, CALCITEM_TYPE_OLAP_MEASURE, CALCITEM_TYPE_TIME, CALCITEM_TYPE_TIMESTAMP
 
Constructor Summary
BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory)
          Constructs an adapter with the specified DataSelection for a new and empty calculated item
BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, com.sas.iquery.metadata.expr.ExpressionInterface expression)
          Deprecated.  
BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, java.lang.Object businessObject)
          Constructs an adapter with the specified DataSelection for a calculated item based on a specific business object.
BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, java.lang.String id, java.lang.String label, java.lang.String description, int type, java.lang.String expr)
          Constructs an adapter with the specified DataSelection for a new calculated item with the given name,desc,type, and text
BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, java.lang.String id, java.lang.String label, java.lang.String description, int type, java.lang.String expr, java.lang.String format)
          Constructs an adapter with the specified DataSelection for a new calculated item with the given name,desc,type, and text
 
Method Summary
 boolean commitChanges()
          Commit changed data
 int convertToCalcItemType(int expressionType, boolean isOLAP)
          Converts a expression type from the com.sas.iquery.metadata.expr.ExpressionTypes to the CalcItem range
 int convertToExpressionType(int calculatedItemType, boolean isOLAP)
          Converts a expression type from CalcItem range to the com.sas.iquery.metadata.expr.ExpressionTypes range
 java.lang.String getBasePeriod()
          Get the starting period set on the item to be used for CUMULATIVE type of calculation
 com.sas.expressions.visuals.DataSourceTreeInterface getBusinessDataSourceTree()
          Get the DataSource tree model from the Business (Data Item) view of the business model
 java.lang.Object getBusinessModelObject()
          Return the business model object (null if new object and not committed yet).
 com.sas.expressions.visuals.DataSourceTreeInterface getDataSourceTree()
          Get the Default DataSource tree model for this business model
 java.lang.String getDescription()
          Gets the description of this calculated item.
 java.lang.String getExpression()
          Gets the String expression representing this calculated item.
 java.lang.String getExpressionAreaString()
           
 int getExpressionType()
          Get the Type of the expression
static java.lang.String getExpressionTypeLabel(int expressionType, boolean isOlap)
           
 java.lang.String getFormat()
          Returns the format string for the calculated item
 com.sas.expressions.visuals.FunctionTreeInterface getFunctionListTree()
          Get the Category Tree with Function Lists model
 java.lang.String getId()
          Gets the unique ID of this calculated item.
 java.lang.String getLabel()
          Gets the label (human readable name) of this calculated item.
 java.lang.String getLastInvalidCalculatedItemMessage()
          get the text reason why validation failed
 java.lang.Exception getLastInvalidExpressionException()
          get the exception of why the calculated items text wasnt valid.
 boolean getLevelHasMembers()
          Determines if the levels of data contained by this adapter have members or not.
 java.util.Map getLevelNameMap(boolean includeHierarchyName)
          Gets the level names in a map with the Level Display names as the keys and the insertable text as the values.
 java.lang.String[] getLevelNames(boolean includeHierarchyName)
          Gets the level names.
 java.util.Locale getLocale()
           
 int getMaxOutputObservations()
          Returns the current maximum number of output observations returned when gathering a list of possible values for a data item or physical item in the data source tree.
 java.lang.Object getMeasureExpression()
          Get the measure Name that this calculation is based upon
 java.util.Map getMeasureNameMap()
          Gets the measure names and each insertable value.
 java.lang.String[] getMeasureNames()
          Gets the measure names.
 java.lang.String[] getMemberNames(java.lang.String levelName)
          Get the member names for a given level.
 java.lang.String getName()
          Deprecated.  
 com.sas.expressions.visuals.OperationListInterface getOperationList()
          Get the Operations List model
 com.sas.expressions.visuals.DataSourceTreeInterface getPhysicalDataSourceTree()
          Get the DataSource tree model from the Physical view of the business model
 com.sas.expressions.visuals.DataSourceTreeInterface getPromptDataSourceTree()
          Get the DataSource tree model containing the prompts of the business model
 java.lang.String getTimeFunction()
          Get the Function name set on this calculated item.
 java.lang.String[] getValidExpressionTypeNames()
          Get an default string descriptions for the valid expression types ordered by how they should appear in a pick list.
 int[] getValidExpressionTypeValues()
          Get an array of the currently valid Types for this expression ordered the same as in getValidExpressionTypeNames() The first one returned should be used as the default value and if only one is returned then the type field must be that value.
 boolean isTimeBasedItem()
          Return if this is a time based calculated item or not.
 boolean isValidateCalculationEnabled()
          is the calculation going to be validated when validate() runs
 void setBasePeriod(java.lang.String basePeriod)
          Set the Starting period for the CUMULATIVE type of calculation, all others type of functions will ignore this
 void setDescription(java.lang.String description)
          Sets the description of this calculated item.
 void setExpression(java.lang.String expr)
          Set the String expression representing this calculated item.
 void setExpressionType(int type)
          Set the Type of the expression representing this calculated item.
 void setFormat(java.lang.String newFormat)
          Sets the format string for the calculated item
 void setId(java.lang.String id)
          Sets the unique ID of this calculated item.
 void setLabel(java.lang.String label)
          Sets the label (human readable name) of this calculated item.
 void setLocale(java.util.Locale locale)
           
 void setMaxOutputObservations(int max)
          Sets the current maximum number of output observations to be returned when gathering a list of possible values for a data item or physical item in the data source tree.
 void setMeasureExpression(java.lang.Object measure)
          Set the measure name that this calculation is based upon
 void setName(java.lang.String name)
          Deprecated.  
 void setTimeFunction(java.lang.String functionLabel)
          Set the Function name to be used in the calculation of thi item
 void setValidateCalculationEnabled(boolean enableCalculation)
          Include the validation of the calculation as part of the required validations that validate() preforms.
 java.lang.String toString()
           
 boolean validate()
          Validates the expression.
 boolean validate(boolean includeCalculation)
          Validates the expression.
 boolean validateCalculation()
          call to validate just the calculation text
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

objectFactory

protected CalculatedObjectFactoryInterface objectFactory
The factory for getting objects and metadata


businessModelObject

protected java.lang.Object businessModelObject
The object that the factory has provided for persistance


id

protected java.lang.String id
The id of this calculated item.


label

protected java.lang.String label
The label (human readable name) of this calculated item.


description

protected java.lang.String description
The description of this calculated item.


expressionType

protected int expressionType
The type of the expression representing this calculated item.


expression

protected java.lang.String expression
The expression representing this calculated item.


format

protected java.lang.String format
The format for this calculated item


function

protected java.lang.String function

measureExpression

protected java.lang.Object measureExpression

basePeriod

protected java.lang.String basePeriod

isTimeBasedItem

protected boolean isTimeBasedItem

timeExpressionMeasure

protected com.sas.iquery.metadata.expr.ExpressionInterface timeExpressionMeasure

validateCalculationEnabled

protected boolean validateCalculationEnabled
True of the calculation is to be validated as part of validate()


ERROR_INVALIDEXPR

public static java.lang.String ERROR_INVALIDEXPR
Constructor Detail

BaseCalculatedItemAdapter

public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory,
                                 java.lang.Object businessObject)
Constructs an adapter with the specified DataSelection for a calculated item based on a specific business object.

Parameters:
objectFactory - is a CalculatedObjectFactoryinterface to use for creating business objects
businessObject - is a Object that the factory will use to initialize a CalculatedItem using updateCalculatedItemFromBusinessModelObject(...)

BaseCalculatedItemAdapter

public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory)
Constructs an adapter with the specified DataSelection for a new and empty calculated item

Parameters:
objectFactory - is a CalculatedObjectFactoryinterface to use for creating business objects

BaseCalculatedItemAdapter

public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory,
                                 java.lang.String id,
                                 java.lang.String label,
                                 java.lang.String description,
                                 int type,
                                 java.lang.String expr)
Constructs an adapter with the specified DataSelection for a new calculated item with the given name,desc,type, and text

Parameters:
objectFactory - is a CalculatedObjectFactoryinterface to use for creating business objects

BaseCalculatedItemAdapter

public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory,
                                 java.lang.String id,
                                 java.lang.String label,
                                 java.lang.String description,
                                 int type,
                                 java.lang.String expr,
                                 java.lang.String format)
Constructs an adapter with the specified DataSelection for a new calculated item with the given name,desc,type, and text

Parameters:
objectFactory - is a CalculatedObjectFactoryinterface to use for creating business objects

BaseCalculatedItemAdapter

public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory,
                                 com.sas.iquery.metadata.expr.ExpressionInterface expression)
Deprecated. 

Constructs an adapter with the specified DataSelection for a new calculated item with the given Expression.

Parameters:
objectFactory - is a CalculatedObjectFactoryinterface to use for creating business objects
Method Detail

setLocale

public void setLocale(java.util.Locale locale)
Specified by:
setLocale in interface CalculatedItemV2Interface

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface CalculatedItemV2Interface

getLevelNameMap

public java.util.Map getLevelNameMap(boolean includeHierarchyName)
Description copied from interface: CalculatedItemMetadataInterface
Gets the level names in a map with the Level Display names as the keys and the insertable text as the values.

Specified by:
getLevelNameMap in interface CalculatedItemMetadataInterface
Parameters:
includeHierarchyName - set to true if the hierarchy name for a given level is to be returned (only used if getLevelHasMembers() is true)
Returns:
a map of String containing the names of the levels, and optionally, the hierarchy name for each level to the insertable text
See Also:
CalculatedItemMetadataInterface.getLevelHasMembers()

getMeasureNameMap

public java.util.Map getMeasureNameMap()
Description copied from interface: CalculatedItemMetadataInterface
Gets the measure names and each insertable value. Measure names are actual names of measures for OLAP, but are numeric type data items for relational.

Specified by:
getMeasureNameMap in interface CalculatedItemMetadataInterface
Returns:
an map of String containing the names of the measures mapped to the insertable value

getLevelNames

public java.lang.String[] getLevelNames(boolean includeHierarchyName)
Description copied from interface: CalculatedItemMetadataInterface
Gets the level names. Level names are level names for OLAP, but are character type data items for relational.

Specified by:
getLevelNames in interface CalculatedItemMetadataInterface
Parameters:
includeHierarchyName - set to true if the hierarchy name for a given level is to be returned (only used if getLevelHasMembers() is true)
Returns:
an array of String containing the names of the levels, and optionally, the hierarchy name for each level.
See Also:
CalculatedItemMetadataInterface.getLevelHasMembers()

getMeasureNames

public java.lang.String[] getMeasureNames()
Description copied from interface: CalculatedItemMetadataInterface
Gets the measure names. Measure names are actual names of measures for OLAP, but are numeric type data items for relational.

Specified by:
getMeasureNames in interface CalculatedItemMetadataInterface
Returns:
an array of String containing the names of the measures

getMemberNames

public java.lang.String[] getMemberNames(java.lang.String levelName)
Description copied from interface: CalculatedItemMetadataInterface
Get the member names for a given level. This method is only meaningful in the case where the level of data contains members (i.e. if getLevelHasMembers() returns true).

Specified by:
getMemberNames in interface CalculatedItemMetadataInterface
Parameters:
levelName - the level for which to get the member names
Returns:
an array of Strings containing the names of the members for the specified level if the adapter contains OLAP data; returns null otherwise.
See Also:
CalculatedItemMetadataInterface.getLevelHasMembers()

getId

public java.lang.String getId()
Description copied from interface: CalculatedItemInterface
Gets the unique ID of this calculated item.

Specified by:
getId in interface CalculatedItemInterface
Returns:
the name of this calculated item, if one has been set; null otherwise.

setId

public void setId(java.lang.String id)
Description copied from interface: CalculatedItemInterface
Sets the unique ID of this calculated item.

Specified by:
setId in interface CalculatedItemInterface

getName

public java.lang.String getName()
Deprecated. 

Description copied from interface: CalculatedItemInterface
Gets the name of this calculated item.

Specified by:
getName in interface CalculatedItemInterface
Returns:
the name of this calculated item, if one has been set; null otherwise.

setName

public void setName(java.lang.String name)
Deprecated. 

Description copied from interface: CalculatedItemInterface
Sets the name of this calculated item.

Specified by:
setName in interface CalculatedItemInterface
Parameters:
name - the name of this calculated item

getLabel

public java.lang.String getLabel()
Description copied from interface: CalculatedItemInterface
Gets the label (human readable name) of this calculated item.

Specified by:
getLabel in interface CalculatedItemInterface
Returns:
the label of this calculated item, if one has been set; null otherwise.

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: CalculatedItemInterface
Sets the label (human readable name) of this calculated item.

Specified by:
setLabel in interface CalculatedItemInterface

getDescription

public java.lang.String getDescription()
Description copied from interface: CalculatedItemInterface
Gets the description of this calculated item.

Specified by:
getDescription in interface CalculatedItemInterface
Returns:
the description of this calculated item, if one has been set; null otherwise.

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: CalculatedItemInterface
Sets the description of this calculated item.

Specified by:
setDescription in interface CalculatedItemInterface
Parameters:
description - the description of this calculated item

getExpression

public java.lang.String getExpression()
Description copied from interface: CalculatedItemInterface
Gets the String expression representing this calculated item.

Specified by:
getExpression in interface CalculatedItemInterface
Returns:
the expression representing this calculated item.

setExpression

public void setExpression(java.lang.String expr)
Description copied from interface: CalculatedItemInterface
Set the String expression representing this calculated item.

Specified by:
setExpression in interface CalculatedItemInterface
Parameters:
expr - the String expression to represent the calculated item.

getLevelHasMembers

public boolean getLevelHasMembers()
Description copied from interface: CalculatedItemMetadataInterface
Determines if the levels of data contained by this adapter have members or not.

Specified by:
getLevelHasMembers in interface CalculatedItemMetadataInterface
Returns:
true if this adapter contains data with members; false otherwise.
See Also:
CalculatedItemMetadataInterface.getMemberNames(String)

getExpressionType

public int getExpressionType()
Description copied from interface: CalculatedItemInterface
Get the Type of the expression

Specified by:
getExpressionType in interface CalculatedItemInterface
Returns:
the type of expression representing this calculated item. (See CALCITEM_TYPE_* constants)

setExpressionType

public void setExpressionType(int type)
Description copied from interface: CalculatedItemInterface
Set the Type of the expression representing this calculated item.

Specified by:
setExpressionType in interface CalculatedItemInterface
Parameters:
type - An int value defining the expression type (See CALCITEM_TYPE_* constants)

getTimeFunction

public java.lang.String getTimeFunction()
Description copied from interface: CalculatedItemV2Interface
Get the Function name set on this calculated item. Supported Functions are DIFFERENCE, PERCENT_CHANGE and CUMULATIVE

Specified by:
getTimeFunction in interface CalculatedItemV2Interface
Returns:
the function name set on this item

setTimeFunction

public void setTimeFunction(java.lang.String functionLabel)
Description copied from interface: CalculatedItemV2Interface
Set the Function name to be used in the calculation of thi item

Specified by:
setTimeFunction in interface CalculatedItemV2Interface
Parameters:
functionLabel - of DIFFERENCE, PERCENT_CHANGE or CUMULATIVE

isTimeBasedItem

public boolean isTimeBasedItem()
Description copied from interface: CalculatedItemV2Interface
Return if this is a time based calculated item or not.

Specified by:
isTimeBasedItem in interface CalculatedItemV2Interface

getMeasureExpression

public java.lang.Object getMeasureExpression()
Description copied from interface: CalculatedItemV2Interface
Get the measure Name that this calculation is based upon

Specified by:
getMeasureExpression in interface CalculatedItemV2Interface
Returns:
Measure name that is used in this calculation

setMeasureExpression

public void setMeasureExpression(java.lang.Object measure)
Description copied from interface: CalculatedItemV2Interface
Set the measure name that this calculation is based upon

Specified by:
setMeasureExpression in interface CalculatedItemV2Interface

getBasePeriod

public java.lang.String getBasePeriod()
Description copied from interface: CalculatedItemV2Interface
Get the starting period set on the item to be used for CUMULATIVE type of calculation

Specified by:
getBasePeriod in interface CalculatedItemV2Interface
Returns:
the starting period (uniqueMember Name on the Time dimension)

setBasePeriod

public void setBasePeriod(java.lang.String basePeriod)
Description copied from interface: CalculatedItemV2Interface
Set the Starting period for the CUMULATIVE type of calculation, all others type of functions will ignore this

Specified by:
setBasePeriod in interface CalculatedItemV2Interface

getExpressionAreaString

public java.lang.String getExpressionAreaString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

commitChanges

public boolean commitChanges()
Commit changed data

Specified by:
commitChanges in interface CalculatedItemInterface
Returns:
boolean true if data updated

getBusinessModelObject

public java.lang.Object getBusinessModelObject()
Return the business model object (null if new object and not committed yet).

Returns:
object null if new object and the data has not been committed

getDataSourceTree

public com.sas.expressions.visuals.DataSourceTreeInterface getDataSourceTree()
Description copied from interface: CalculatedItemMetadataInterface
Get the Default DataSource tree model for this business model

Specified by:
getDataSourceTree in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.DataSourceTreeInterface containing the data sources that can be added in the Expression Editor (null allowed if not supported)

getPhysicalDataSourceTree

public com.sas.expressions.visuals.DataSourceTreeInterface getPhysicalDataSourceTree()
Description copied from interface: CalculatedItemMetadataInterface
Get the DataSource tree model from the Physical view of the business model

Specified by:
getPhysicalDataSourceTree in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.DataSourceTreeInterface containing the data sources that can be added in the Expression Editor (null allowed if not supported)

getBusinessDataSourceTree

public com.sas.expressions.visuals.DataSourceTreeInterface getBusinessDataSourceTree()
Description copied from interface: CalculatedItemMetadataInterface
Get the DataSource tree model from the Business (Data Item) view of the business model

Specified by:
getBusinessDataSourceTree in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.DataSourceTreeInterface containing the data sources that can be added in the Expression Editor (null allowed if not supported)

getPromptDataSourceTree

public com.sas.expressions.visuals.DataSourceTreeInterface getPromptDataSourceTree()
Description copied from interface: CalculatedItemMetadataInterface
Get the DataSource tree model containing the prompts of the business model

Specified by:
getPromptDataSourceTree in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.DataSourceTreeInterface containing the data sources that can be added in the Expression Editor (null allowed if not supported)

getFunctionListTree

public com.sas.expressions.visuals.FunctionTreeInterface getFunctionListTree()
Description copied from interface: CalculatedItemMetadataInterface
Get the Category Tree with Function Lists model

Specified by:
getFunctionListTree in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.FunctionTreeInterface containing the Categories with Functions that can be added in the Expression Editor (null allowed if not supported)

getOperationList

public com.sas.expressions.visuals.OperationListInterface getOperationList()
Description copied from interface: CalculatedItemMetadataInterface
Get the Operations List model

Specified by:
getOperationList in interface CalculatedItemMetadataInterface
Returns:
a com.sas.expressions.visuals.OperationListInterface containing the Operations that can be added in the Expression Editor (null allowed if not supported)

getValidExpressionTypeNames

public java.lang.String[] getValidExpressionTypeNames()
Description copied from interface: CalculatedItemInterface
Get an default string descriptions for the valid expression types ordered by how they should appear in a pick list. The first one returned should be used as the default value and if only one is returned then the type field must be that value.

Specified by:
getValidExpressionTypeNames in interface CalculatedItemInterface
Returns:
String[] Names for the expression types

getValidExpressionTypeValues

public int[] getValidExpressionTypeValues()
Description copied from interface: CalculatedItemInterface
Get an array of the currently valid Types for this expression ordered the same as in getValidExpressionTypeNames() The first one returned should be used as the default value and if only one is returned then the type field must be that value.

Specified by:
getValidExpressionTypeValues in interface CalculatedItemInterface
Returns:
int[] Int values for the expression types

convertToCalcItemType

public int convertToCalcItemType(int expressionType,
                                 boolean isOLAP)
Description copied from interface: CalculatedItemInterface
Converts a expression type from the com.sas.iquery.metadata.expr.ExpressionTypes to the CalcItem range

Specified by:
convertToCalcItemType in interface CalculatedItemInterface

convertToExpressionType

public int convertToExpressionType(int calculatedItemType,
                                   boolean isOLAP)
Description copied from interface: CalculatedItemInterface
Converts a expression type from CalcItem range to the com.sas.iquery.metadata.expr.ExpressionTypes range

Specified by:
convertToExpressionType in interface CalculatedItemInterface

getExpressionTypeLabel

public static java.lang.String getExpressionTypeLabel(int expressionType,
                                                      boolean isOlap)

getFormat

public java.lang.String getFormat()
Returns the format string for the calculated item

Specified by:
getFormat in interface CalculatedItemInterface
Returns:
The format string.

setFormat

public void setFormat(java.lang.String newFormat)
Sets the format string for the calculated item

Specified by:
setFormat in interface CalculatedItemInterface
Parameters:
The - format string.

setValidateCalculationEnabled

public void setValidateCalculationEnabled(boolean enableCalculation)
Include the validation of the calculation as part of the required validations that validate() preforms. This is enabled by default for backward compatibility

Specified by:
setValidateCalculationEnabled in interface CalculatedItemInterface
Parameters:
boolean - false if the required validations are not to include validating the calculation text

isValidateCalculationEnabled

public boolean isValidateCalculationEnabled()
is the calculation going to be validated when validate() runs

Specified by:
isValidateCalculationEnabled in interface CalculatedItemInterface
Returns:
boolean true if the calculation is going to be validated when validate() is done

validate

public boolean validate()
Validates the expression. If isValidateCalculationEnabled() is false it will skip validating the calculation text.

Specified by:
validate in interface CalculatedItemInterface
Returns:
boolean true if this will be a valid expression when committed

validate

public boolean validate(boolean includeCalculation)
Validates the expression.

Specified by:
validate in interface CalculatedItemInterface
Parameters:
boolean - if false it will skip validating the calculation text.
Returns:
boolean true if this will be a valid expression when committed

validateCalculation

public boolean validateCalculation()
call to validate just the calculation text

Specified by:
validateCalculation in interface CalculatedItemInterface
Returns:
boolean true if the calculation text is a valid expression

getLastInvalidCalculatedItemMessage

public java.lang.String getLastInvalidCalculatedItemMessage()
get the text reason why validation failed

Specified by:
getLastInvalidCalculatedItemMessage in interface CalculatedItemInterface
Returns:
string

getLastInvalidExpressionException

public java.lang.Exception getLastInvalidExpressionException()
get the exception of why the calculated items text wasnt valid. This is only valid if the calculation text was actually validated.

Specified by:
getLastInvalidExpressionException in interface CalculatedItemInterface
Returns:
exception

getMaxOutputObservations

public int getMaxOutputObservations()
Returns the current maximum number of output observations returned when gathering a list of possible values for a data item or physical item in the data source tree.

Specified by:
getMaxOutputObservations in interface CalculatedItemMetadataInterface
Returns:
the maximum number of output observations

setMaxOutputObservations

public void setMaxOutputObservations(int max)
Sets the current maximum number of output observations to be returned when gathering a list of possible values for a data item or physical item in the data source tree.

Specified by:
setMaxOutputObservations in interface CalculatedItemMetadataInterface
Parameters:
max - the new maximum number of output observations
See Also:
Governing



Copyright © 2009 SAS Institute Inc. All Rights Reserved.