com.sas.dataselectors.calculateditems
Interface CalculatedItemInterface

All Superinterfaces:
CalculatedItemMetadataInterface
All Known Subinterfaces:
CalculatedItemV2Interface
All Known Implementing Classes:
BaseCalculatedItemAdapter, BusinessModelToCalculatedItemAdapter, BusinessQueryToCalculatedItemAdapter, DataSelectionToCalculatedItemAdapter, InformationMapToCalculatedItemAdapter

public interface CalculatedItemInterface
extends CalculatedItemMetadataInterface

Represents a calculated item and serves as the interface between a data model and the calculated item selectors.


Field Summary
static int CALCITEM_TYPE_BITSTRING
          A Column or other scalar expression.
static int CALCITEM_TYPE_BOOLEAN
          A true or false value.
static int CALCITEM_TYPE_CHARACTER
          A character based column or character expression.
static int CALCITEM_TYPE_DATE
          A date value
static int CALCITEM_TYPE_INTERVAL_DT
          An interval value--- Date and time only
static int CALCITEM_TYPE_INTERVAL_YM
          An interval value--- YEAR and MONTH only
static int CALCITEM_TYPE_NOT_SET
          Unset or Invalid expression
static int CALCITEM_TYPE_NUMERIC
          A Numeric column or numeric expression.
static int CALCITEM_TYPE_OLAP_CATEGORY
          An OLAP Category
static int CALCITEM_TYPE_OLAP_MEASURE
          An OLAP Measure
static int CALCITEM_TYPE_TIME
          A time value
static int CALCITEM_TYPE_TIMESTAMP
          A timestamp value
 
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 getDescription()
          Gets the description of this calculated item.
 java.lang.String getExpression()
          Gets the String expression representing this calculated item.
 int getExpressionType()
          Get the Type of the expression
 java.lang.String getFormat()
          Returns the format string for the calculated item
 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.
 java.lang.String getName()
          Deprecated.  
 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 isValidateCalculationEnabled()
          is the calculation going to be validated when validate() runs
 void setDescription(java.lang.String description)
          Sets the description of this calculated item.
 void setExpression(java.lang.String expression)
          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 format)
          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 setName(java.lang.String name)
          Deprecated.  
 void setValidateCalculationEnabled(boolean enableCalculation)
          Include the validation of the calculation as part of the required validations that validate() preforms.
 boolean validate()
          Validates the expression.
 boolean validate(boolean includeCalculation)
          Validates the expression.
 boolean validateCalculation()
          call to validate just the calculation text
 
Methods inherited from interface com.sas.dataselectors.calculateditems.CalculatedItemMetadataInterface
getBusinessDataSourceTree, getDataSourceTree, getFunctionListTree, getLevelHasMembers, getLevelNameMap, getLevelNames, getMaxOutputObservations, getMeasureNameMap, getMeasureNames, getMemberNames, getOperationList, getPhysicalDataSourceTree, getPromptDataSourceTree, setMaxOutputObservations
 

Field Detail

CALCITEM_TYPE_NOT_SET

static final int CALCITEM_TYPE_NOT_SET
Unset or Invalid expression

See Also:
Constant Field Values

CALCITEM_TYPE_BITSTRING

static final int CALCITEM_TYPE_BITSTRING
A Column or other scalar expression.

See Also:
Constant Field Values

CALCITEM_TYPE_NUMERIC

static final int CALCITEM_TYPE_NUMERIC
A Numeric column or numeric expression.

See Also:
Constant Field Values

CALCITEM_TYPE_CHARACTER

static final int CALCITEM_TYPE_CHARACTER
A character based column or character expression.

See Also:
Constant Field Values

CALCITEM_TYPE_DATE

static final int CALCITEM_TYPE_DATE
A date value

See Also:
Constant Field Values

CALCITEM_TYPE_TIME

static final int CALCITEM_TYPE_TIME
A time value

See Also:
Constant Field Values

CALCITEM_TYPE_TIMESTAMP

static final int CALCITEM_TYPE_TIMESTAMP
A timestamp value

See Also:
Constant Field Values

CALCITEM_TYPE_INTERVAL_YM

static final int CALCITEM_TYPE_INTERVAL_YM
An interval value--- YEAR and MONTH only

See Also:
Constant Field Values

CALCITEM_TYPE_INTERVAL_DT

static final int CALCITEM_TYPE_INTERVAL_DT
An interval value--- Date and time only

See Also:
Constant Field Values

CALCITEM_TYPE_BOOLEAN

static final int CALCITEM_TYPE_BOOLEAN
A true or false value.

See Also:
Constant Field Values

CALCITEM_TYPE_OLAP_MEASURE

static final int CALCITEM_TYPE_OLAP_MEASURE
An OLAP Measure

See Also:
Constant Field Values

CALCITEM_TYPE_OLAP_CATEGORY

static final int CALCITEM_TYPE_OLAP_CATEGORY
An OLAP Category

See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
Gets the unique ID of this calculated item.

Returns:
the name of this calculated item, if one has been set; null otherwise.

setId

void setId(java.lang.String id)
Sets the unique ID of this calculated item.

Parameters:
name - the name of this calculated item

getName

java.lang.String getName()
Deprecated. 

Gets the name of this calculated item.

Returns:
the name of this calculated item, if one has been set; null otherwise.

setName

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

Sets the name of this calculated item.

Parameters:
name - the name of this calculated item

getLabel

java.lang.String getLabel()
Gets the label (human readable name) of this calculated item.

Returns:
the label of this calculated item, if one has been set; null otherwise.

setLabel

void setLabel(java.lang.String label)
Sets the label (human readable name) of this calculated item.

Parameters:
name - the name of this calculated item

getDescription

java.lang.String getDescription()
Gets the description of this calculated item.

Returns:
the description of this calculated item, if one has been set; null otherwise.

setDescription

void setDescription(java.lang.String description)
Sets the description of this calculated item.

Parameters:
description - the description of this calculated item

getExpression

java.lang.String getExpression()
Gets the String expression representing this calculated item.

Returns:
the expression representing this calculated item.

setExpression

void setExpression(java.lang.String expression)
Set the String expression representing this calculated item.

Parameters:
expression - the String expression to represent the calculated item.

getExpressionType

int getExpressionType()
Get the Type of the expression

Returns:
the type of expression representing this calculated item. (See CALCITEM_TYPE_* constants)

setExpressionType

void setExpressionType(int type)
Set the Type of the expression representing this calculated item.

Parameters:
type - An int value defining the expression type (See CALCITEM_TYPE_* constants)

commitChanges

boolean commitChanges()
Commit changed data

Returns:
boolean true if data updated

getValidExpressionTypeNames

java.lang.String[] getValidExpressionTypeNames()
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.

Returns:
String[] Names for the expression types

getValidExpressionTypeValues

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.

Returns:
int[] Int values for the expression types

convertToCalcItemType

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


convertToExpressionType

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


getFormat

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

Returns:
The format string.

setFormat

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

Parameters:
The - format string.

setValidateCalculationEnabled

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

Parameters:
boolean - false if the required validations are not to include validating the calculation text

isValidateCalculationEnabled

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

Returns:
boolean true if the calculation is going to be validated when validate() is done

validate

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

Returns:
boolean true if this will be a valid expression when committed

validate

boolean validate(boolean includeCalculation)
Validates the expression.

Parameters:
boolean - if false it will skip validating the calculation text.
Returns:
boolean true if this will be a valid expression when committed

validateCalculation

boolean validateCalculation()
call to validate just the calculation text

Returns:
boolean true if the calculation text is a valid expression

getLastInvalidCalculatedItemMessage

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

Returns:
string

getLastInvalidExpressionException

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.

Returns:
exception



Copyright © 2009 SAS Institute Inc. All Rights Reserved.