com.sas.dataselectors.calculateditems
Class BaseCalculatedItemListAdapter

com.sas.dataselectors.calculateditems.BaseCalculatedItemListAdapter
All Implemented Interfaces:
CalculatedItemListInterface, CalculatedItemListV2Interface, CalculatedItemMetadataInterface
Direct Known Subclasses:
BusinessModelToCalculatedItemListAdapter, BusinessQueryToCalculatedItemListAdapter, DataSelectionToCalculatedItemListAdapter

public abstract class BaseCalculatedItemListAdapter
implements CalculatedItemListV2Interface

Description: This is the base adapter for going from a CalculatedObjectFactoryInterface to a CalculatedItemListInterface. The super implementation should mint a CalculatedObjectFactoryInterface as needed. Copyright: Copyright (c) 2002 Company: SAS


Nested Class Summary
 class BaseCalculatedItemListAdapter.InnerListOfCalculatedItems
          Description: List implementation to work with calculated items
 
Field Summary
protected  java.util.List _calculatedItemList
          The List storing the calculated items in this dataselection.
protected  java.lang.String _description
          The description of this calculated item.
protected  java.lang.String _name
          The name of this calculated item.
protected  CalculatedObjectFactoryInterface _objectFactory
          The factory for getting objects and metadata
protected  int _selectionIndex
          The currently selected Calculated Item index (-1 = unselected)
static java.lang.String RB_KEY
           
 
Method Summary
 boolean addCalculatedItem(CalculatedItemInterface value)
          adds to the end of the list (cursor position undefined after an add)
 boolean canRemoveAllCalculatedItems()
          returns true if the list can be empty upon commit and false if at least one item must exist
 void clearSelectionCursor()
          resets the selection cursor so that the isCalculatedItemSelected() call returns false
 boolean commitChanges()
          Commit changed data
 com.sas.expressions.visuals.DataSourceTreeInterface getBusinessDataSourceTree()
          Get the DataSource tree model from the Business (Data Item) view of the business model
 java.util.List getCalculatedItemList()
          get the list of filter test nodes
 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 list.
 FormatAdapterInterface getFormatAdapter()
          returns the format adapter
 com.sas.expressions.visuals.FunctionTreeInterface getFunctionListTree()
          Get the Category Tree with Function Lists model
 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 getMaxLengthOfItemName()
          returns the maximum length of the name of a calculated item
 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.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()
          Gets the name of this calculated item list.
 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
 CalculatedItemInterface getSelectedCalculatedItem()
          Get the CalculatedItemInterface of the current selection
 int getSelectionCount()
          get the number of selectable entries in the model
 int getSelectionCursor()
          get the index of the selection model cursor
 java.lang.Object getTimeHierarchy()
           
 boolean isCalculatedItemSelected()
          true if there is a selected calculated item
 boolean isTimeDimensionPresent()
          Returns if a time dimension is present in the query
 CalculatedItemInterface newCalculatedItem()
          creates a new CalculatedItemInterface that is not persisted or added to the list yet
 CalculatedItemInterface newCalculatedItem(CalculatedItemInterface toBeCloned)
          creates a clone of a CalculatedItemInterface that is not persisted or added to the list yet
 void removeAllCalculatedItems()
          removes all of the items from the List
 void removeSelectedCalculatedItem()
          removes the current selection from the List (cursor position is undefined after remove) Calculated Items are not fully removed from presistance until the commit call is made.
 void setDescription(java.lang.String description)
          Sets the description of this calculated item list.
 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 setName(java.lang.String name)
          Sets the name of this calculated item list.
 void setSelectionCursor(int index)
          move the selection model cursor to a new selection index
 void updateSelectedCalculatedItem(CalculatedItemInterface value)
          Update the CalculatedItemInterface of the current selection
 

Field Detail

RB_KEY

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

_name

protected java.lang.String _name
The name of this calculated item.


_description

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


_calculatedItemList

protected java.util.List _calculatedItemList
The List storing the calculated items in this dataselection.


_objectFactory

protected CalculatedObjectFactoryInterface _objectFactory
The factory for getting objects and metadata


_selectionIndex

protected int _selectionIndex
The currently selected Calculated Item index (-1 = unselected)

Method Detail

getName

public java.lang.String getName()
Description copied from interface: CalculatedItemListInterface
Gets the name of this calculated item list.

Specified by:
getName in interface CalculatedItemListInterface
Returns:
the name of this calculated item list, if one has been set; null otherwise.
See Also:
CalculatedItemListInterface.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: CalculatedItemListInterface
Sets the name of this calculated item list.

Specified by:
setName in interface CalculatedItemListInterface
Parameters:
name - the name of this calculated item list
See Also:
CalculatedItemListInterface.setName(String)

getDescription

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

Specified by:
getDescription in interface CalculatedItemListInterface
Returns:
the description of this calculated item list, if one has been set; null otherwise.
See Also:
CalculatedItemListInterface.getDescription()

setDescription

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

Specified by:
setDescription in interface CalculatedItemListInterface
Parameters:
description - the description of this calculated item list
See Also:
CalculatedItemListInterface.setDescription(String)

getCalculatedItemList

public java.util.List getCalculatedItemList()
Description copied from interface: CalculatedItemListInterface
get the list of filter test nodes

Specified by:
getCalculatedItemList in interface CalculatedItemListInterface
See Also:
CalculatedItemListInterface.getCalculatedItemList()

commitChanges

public boolean commitChanges()
Commit changed data

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

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)

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()

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()

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

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()

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)

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)

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)

removeAllCalculatedItems

public void removeAllCalculatedItems()
Description copied from interface: CalculatedItemListInterface
removes all of the items from the List

Specified by:
removeAllCalculatedItems in interface CalculatedItemListInterface

isTimeDimensionPresent

public boolean isTimeDimensionPresent()
Description copied from interface: CalculatedItemListV2Interface
Returns if a time dimension is present in the query

Specified by:
isTimeDimensionPresent in interface CalculatedItemListV2Interface
Returns:
true if time dimension calculations can be performed

getTimeHierarchy

public java.lang.Object getTimeHierarchy()
Specified by:
getTimeHierarchy in interface CalculatedItemListV2Interface

setLocale

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

getLocale

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

newCalculatedItem

public CalculatedItemInterface newCalculatedItem()
Description copied from interface: CalculatedItemListInterface
creates a new CalculatedItemInterface that is not persisted or added to the list yet

Specified by:
newCalculatedItem in interface CalculatedItemListInterface
Returns:
CalculatedItemInterface

newCalculatedItem

public CalculatedItemInterface newCalculatedItem(CalculatedItemInterface toBeCloned)
Description copied from interface: CalculatedItemListInterface
creates a clone of a CalculatedItemInterface that is not persisted or added to the list yet

Specified by:
newCalculatedItem in interface CalculatedItemListInterface
Returns:
CalculatedItemInterface

addCalculatedItem

public boolean addCalculatedItem(CalculatedItemInterface value)
Description copied from interface: CalculatedItemListInterface
adds to the end of the list (cursor position undefined after an add)

Specified by:
addCalculatedItem in interface CalculatedItemListInterface
Returns:
boolean true if successful

isCalculatedItemSelected

public boolean isCalculatedItemSelected()
Description copied from interface: CalculatedItemListInterface
true if there is a selected calculated item

Specified by:
isCalculatedItemSelected in interface CalculatedItemListInterface
Returns:
boolean True if there is a calculated item selected

clearSelectionCursor

public void clearSelectionCursor()
Description copied from interface: CalculatedItemListInterface
resets the selection cursor so that the isCalculatedItemSelected() call returns false

Specified by:
clearSelectionCursor in interface CalculatedItemListInterface

getSelectionCount

public int getSelectionCount()
Description copied from interface: CalculatedItemListInterface
get the number of selectable entries in the model

Specified by:
getSelectionCount in interface CalculatedItemListInterface

getSelectionCursor

public int getSelectionCursor()
Description copied from interface: CalculatedItemListInterface
get the index of the selection model cursor

Specified by:
getSelectionCursor in interface CalculatedItemListInterface
Returns:
int the 0 based indes in the list of the current selection

setSelectionCursor

public void setSelectionCursor(int index)
Description copied from interface: CalculatedItemListInterface
move the selection model cursor to a new selection index

Specified by:
setSelectionCursor in interface CalculatedItemListInterface

getSelectedCalculatedItem

public CalculatedItemInterface getSelectedCalculatedItem()
Description copied from interface: CalculatedItemListInterface
Get the CalculatedItemInterface of the current selection

Specified by:
getSelectedCalculatedItem in interface CalculatedItemListInterface

updateSelectedCalculatedItem

public void updateSelectedCalculatedItem(CalculatedItemInterface value)
Description copied from interface: CalculatedItemListInterface
Update the CalculatedItemInterface of the current selection

Specified by:
updateSelectedCalculatedItem in interface CalculatedItemListInterface

removeSelectedCalculatedItem

public void removeSelectedCalculatedItem()
Description copied from interface: CalculatedItemListInterface
removes the current selection from the List (cursor position is undefined after remove) Calculated Items are not fully removed from presistance until the commit call is made.

Specified by:
removeSelectedCalculatedItem in interface CalculatedItemListInterface

canRemoveAllCalculatedItems

public boolean canRemoveAllCalculatedItems()
Description copied from interface: CalculatedItemListInterface
returns true if the list can be empty upon commit and false if at least one item must exist

Specified by:
canRemoveAllCalculatedItems in interface CalculatedItemListInterface

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

getFormatAdapter

public FormatAdapterInterface getFormatAdapter()
Description copied from interface: CalculatedItemListInterface
returns the format adapter

Specified by:
getFormatAdapter in interface CalculatedItemListInterface

getMaxLengthOfItemName

public int getMaxLengthOfItemName()
Description copied from interface: CalculatedItemListInterface
returns the maximum length of the name of a calculated item

Specified by:
getMaxLengthOfItemName in interface CalculatedItemListInterface



Copyright © 2009 SAS Institute Inc. All Rights Reserved.