|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.dataselectors.calculateditems.BaseCalculatedItemAdapter
public abstract class BaseCalculatedItemAdapter
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 |
---|
public static final java.lang.String RB_KEY
protected CalculatedObjectFactoryInterface objectFactory
protected java.lang.Object businessModelObject
protected java.lang.String id
protected java.lang.String label
protected java.lang.String description
protected int expressionType
protected java.lang.String expression
protected java.lang.String format
protected java.lang.String function
protected java.lang.Object measureExpression
protected java.lang.String basePeriod
protected boolean isTimeBasedItem
protected com.sas.iquery.metadata.expr.ExpressionInterface timeExpressionMeasure
protected boolean validateCalculationEnabled
public static java.lang.String ERROR_INVALIDEXPR
Constructor Detail |
---|
public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, java.lang.Object businessObject)
objectFactory
- is a CalculatedObjectFactoryinterface to use for creating business objectsbusinessObject
- is a Object that the factory will use to initialize a CalculatedItem using updateCalculatedItemFromBusinessModelObject(...)public BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory)
objectFactory
- is a CalculatedObjectFactoryinterface to use for creating business objectspublic BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, java.lang.String id, java.lang.String label, java.lang.String description, int type, java.lang.String expr)
objectFactory
- is a CalculatedObjectFactoryinterface to use for creating business objectspublic 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)
objectFactory
- is a CalculatedObjectFactoryinterface to use for creating business objectspublic BaseCalculatedItemAdapter(CalculatedObjectFactoryInterface factory, com.sas.iquery.metadata.expr.ExpressionInterface expression)
objectFactory
- is a CalculatedObjectFactoryinterface to use for creating business objectsMethod Detail |
---|
public void setLocale(java.util.Locale locale)
setLocale
in interface CalculatedItemV2Interface
public java.util.Locale getLocale()
getLocale
in interface CalculatedItemV2Interface
public java.util.Map getLevelNameMap(boolean includeHierarchyName)
CalculatedItemMetadataInterface
getLevelNameMap
in interface CalculatedItemMetadataInterface
includeHierarchyName
- set to true if the hierarchy name for a given level is to
be returned (only used if getLevelHasMembers() is true)
CalculatedItemMetadataInterface.getLevelHasMembers()
public java.util.Map getMeasureNameMap()
CalculatedItemMetadataInterface
getMeasureNameMap
in interface CalculatedItemMetadataInterface
public java.lang.String[] getLevelNames(boolean includeHierarchyName)
CalculatedItemMetadataInterface
getLevelNames
in interface CalculatedItemMetadataInterface
includeHierarchyName
- set to true if the hierarchy name for a given level is to
be returned (only used if getLevelHasMembers() is true)
CalculatedItemMetadataInterface.getLevelHasMembers()
public java.lang.String[] getMeasureNames()
CalculatedItemMetadataInterface
getMeasureNames
in interface CalculatedItemMetadataInterface
public java.lang.String[] getMemberNames(java.lang.String levelName)
CalculatedItemMetadataInterface
getMemberNames
in interface CalculatedItemMetadataInterface
levelName
- the level for which to get the member names
CalculatedItemMetadataInterface.getLevelHasMembers()
public java.lang.String getId()
CalculatedItemInterface
getId
in interface CalculatedItemInterface
public void setId(java.lang.String id)
CalculatedItemInterface
setId
in interface CalculatedItemInterface
public java.lang.String getName()
CalculatedItemInterface
getName
in interface CalculatedItemInterface
public void setName(java.lang.String name)
CalculatedItemInterface
setName
in interface CalculatedItemInterface
name
- the name of this calculated itempublic java.lang.String getLabel()
CalculatedItemInterface
getLabel
in interface CalculatedItemInterface
public void setLabel(java.lang.String label)
CalculatedItemInterface
setLabel
in interface CalculatedItemInterface
public java.lang.String getDescription()
CalculatedItemInterface
getDescription
in interface CalculatedItemInterface
public void setDescription(java.lang.String description)
CalculatedItemInterface
setDescription
in interface CalculatedItemInterface
description
- the description of this calculated itempublic java.lang.String getExpression()
CalculatedItemInterface
getExpression
in interface CalculatedItemInterface
public void setExpression(java.lang.String expr)
CalculatedItemInterface
setExpression
in interface CalculatedItemInterface
expr
- the String expression to represent the calculated item.public boolean getLevelHasMembers()
CalculatedItemMetadataInterface
getLevelHasMembers
in interface CalculatedItemMetadataInterface
CalculatedItemMetadataInterface.getMemberNames(String)
public int getExpressionType()
CalculatedItemInterface
getExpressionType
in interface CalculatedItemInterface
public void setExpressionType(int type)
CalculatedItemInterface
setExpressionType
in interface CalculatedItemInterface
type
- An int value defining the expression type (See CALCITEM_TYPE_* constants)public java.lang.String getTimeFunction()
CalculatedItemV2Interface
getTimeFunction
in interface CalculatedItemV2Interface
public void setTimeFunction(java.lang.String functionLabel)
CalculatedItemV2Interface
setTimeFunction
in interface CalculatedItemV2Interface
functionLabel
- of DIFFERENCE, PERCENT_CHANGE or CUMULATIVEpublic boolean isTimeBasedItem()
CalculatedItemV2Interface
isTimeBasedItem
in interface CalculatedItemV2Interface
public java.lang.Object getMeasureExpression()
CalculatedItemV2Interface
getMeasureExpression
in interface CalculatedItemV2Interface
public void setMeasureExpression(java.lang.Object measure)
CalculatedItemV2Interface
setMeasureExpression
in interface CalculatedItemV2Interface
public java.lang.String getBasePeriod()
CalculatedItemV2Interface
getBasePeriod
in interface CalculatedItemV2Interface
public void setBasePeriod(java.lang.String basePeriod)
CalculatedItemV2Interface
setBasePeriod
in interface CalculatedItemV2Interface
public java.lang.String getExpressionAreaString()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean commitChanges()
commitChanges
in interface CalculatedItemInterface
public java.lang.Object getBusinessModelObject()
public com.sas.expressions.visuals.DataSourceTreeInterface getDataSourceTree()
CalculatedItemMetadataInterface
getDataSourceTree
in interface CalculatedItemMetadataInterface
public com.sas.expressions.visuals.DataSourceTreeInterface getPhysicalDataSourceTree()
CalculatedItemMetadataInterface
getPhysicalDataSourceTree
in interface CalculatedItemMetadataInterface
public com.sas.expressions.visuals.DataSourceTreeInterface getBusinessDataSourceTree()
CalculatedItemMetadataInterface
getBusinessDataSourceTree
in interface CalculatedItemMetadataInterface
public com.sas.expressions.visuals.DataSourceTreeInterface getPromptDataSourceTree()
CalculatedItemMetadataInterface
getPromptDataSourceTree
in interface CalculatedItemMetadataInterface
public com.sas.expressions.visuals.FunctionTreeInterface getFunctionListTree()
CalculatedItemMetadataInterface
getFunctionListTree
in interface CalculatedItemMetadataInterface
public com.sas.expressions.visuals.OperationListInterface getOperationList()
CalculatedItemMetadataInterface
getOperationList
in interface CalculatedItemMetadataInterface
public java.lang.String[] getValidExpressionTypeNames()
CalculatedItemInterface
getValidExpressionTypeNames
in interface CalculatedItemInterface
public int[] getValidExpressionTypeValues()
CalculatedItemInterface
getValidExpressionTypeValues
in interface CalculatedItemInterface
public int convertToCalcItemType(int expressionType, boolean isOLAP)
CalculatedItemInterface
convertToCalcItemType
in interface CalculatedItemInterface
public int convertToExpressionType(int calculatedItemType, boolean isOLAP)
CalculatedItemInterface
convertToExpressionType
in interface CalculatedItemInterface
public static java.lang.String getExpressionTypeLabel(int expressionType, boolean isOlap)
public java.lang.String getFormat()
getFormat
in interface CalculatedItemInterface
public void setFormat(java.lang.String newFormat)
setFormat
in interface CalculatedItemInterface
The
- format string.public void setValidateCalculationEnabled(boolean enableCalculation)
setValidateCalculationEnabled
in interface CalculatedItemInterface
boolean
- false if the required validations are not to include validating the calculation textpublic boolean isValidateCalculationEnabled()
isValidateCalculationEnabled
in interface CalculatedItemInterface
public boolean validate()
validate
in interface CalculatedItemInterface
public boolean validate(boolean includeCalculation)
validate
in interface CalculatedItemInterface
boolean
- if false it will skip validating the calculation text.
public boolean validateCalculation()
validateCalculation
in interface CalculatedItemInterface
public java.lang.String getLastInvalidCalculatedItemMessage()
getLastInvalidCalculatedItemMessage
in interface CalculatedItemInterface
public java.lang.Exception getLastInvalidExpressionException()
getLastInvalidExpressionException
in interface CalculatedItemInterface
public int getMaxOutputObservations()
getMaxOutputObservations
in interface CalculatedItemMetadataInterface
public void setMaxOutputObservations(int max)
setMaxOutputObservations
in interface CalculatedItemMetadataInterface
max
- the new maximum number of output observationsGoverning
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |