com.sas.dataselectors.calculations.percent
Class BasePercentCalculationsSelectorAdapter

com.sas.dataselectors.calculations.percent.BasePercentCalculationsSelectorAdapter
All Implemented Interfaces:
PercentCalculationsSelectorInterface, SelectorCommitInterface
Direct Known Subclasses:
OLAPPercentCalculationsSelectorAdapter

public class BasePercentCalculationsSelectorAdapter
implements PercentCalculationsSelectorInterface

Base class that contains attributes and methods common to the different Percent Of Totals Calculation Selector adapters.

Since:
3.1.4

Field Summary
protected  PercentCalculationsSelectorDataSourceInterface dataSource
          The data model used by the adapter.
protected  java.util.List fractionalItems
          The data model used by the adapter.
 
Fields inherited from interface com.sas.dataselectors.SelectorCommitInterface
EXCEPTION_OCCURRED
 
Constructor Summary
BasePercentCalculationsSelectorAdapter()
          Default constructor.
BasePercentCalculationsSelectorAdapter(PercentCalculationsSelectorDataSourceInterface dataSource)
          PercentCalculationsSelectorDataSourceInterface constructor.
 
Method Summary
 java.util.Map commit()
           Commits the current set of fractional items to this adapter's associated model.
protected  PercentCalculationsSelectorDataSourceInterface getDataSource()
          Returns the dataSource object that performs model-specific operations for this adapter.
 java.util.Map getDenominators()
          Returns a map where the keys are the denominator ids and the the values are the denominator labels.
 java.util.List getFractionalItems()
           Returns a list of items representing the current set of fractional items.
 java.util.Locale getLocale()
          Returns the locale
 java.util.Map getNumerators()
          Returns a map where the keys are the numerator ids and the the values are the numerator labels.
 java.lang.Object getPropertiesBean()
           Required to satisfy the SelectorCommitInterface but not used in this implementation.
 boolean isOLAP()
          Returns true if the data source for this adapter is OLAP based.
protected  void setDataSource(PercentCalculationsSelectorDataSourceInterface dataSource)
          Sets the dataSource object that performs model-specific operations for this adapter.
 void setFractionalItems(java.util.List items)
           Sets the list of items that represent the new set of fractional items.
 void setLocale(java.util.Locale locale)
          Sets the locale
 

Field Detail

dataSource

protected PercentCalculationsSelectorDataSourceInterface dataSource
The data model used by the adapter.


fractionalItems

protected java.util.List fractionalItems
The data model used by the adapter.

Constructor Detail

BasePercentCalculationsSelectorAdapter

public BasePercentCalculationsSelectorAdapter()
Default constructor.


BasePercentCalculationsSelectorAdapter

public BasePercentCalculationsSelectorAdapter(PercentCalculationsSelectorDataSourceInterface dataSource)
PercentCalculationsSelectorDataSourceInterface constructor.

Parameters:
dataSource - the object that performs model-specific operations for this adapter.
Method Detail

setDataSource

protected void setDataSource(PercentCalculationsSelectorDataSourceInterface dataSource)
Sets the dataSource object that performs model-specific operations for this adapter.

Parameters:
dataSource - the object that performs model-specific operations.

getDataSource

protected PercentCalculationsSelectorDataSourceInterface getDataSource()
Returns the dataSource object that performs model-specific operations for this adapter.

Returns:
the dataSource object that performs model-specific operations.

getNumerators

public java.util.Map getNumerators()
Returns a map where the keys are the numerator ids and the the values are the numerator labels.

Specified by:
getNumerators in interface PercentCalculationsSelectorInterface
Returns:
the map of numerator ids and labels.
Throws:
{@link - java.lang.IllegalStateException} if dataSource is null.

getDenominators

public java.util.Map getDenominators()
Returns a map where the keys are the denominator ids and the the values are the denominator labels.

Specified by:
getDenominators in interface PercentCalculationsSelectorInterface
Returns:
the map of denominator ids and labels.
Throws:
{@link - java.lang.IllegalStateException} if dataSource is null.

isOLAP

public boolean isOLAP()
Returns true if the data source for this adapter is OLAP based.

Specified by:
isOLAP in interface PercentCalculationsSelectorInterface
Returns:
TRUE if the data source is OLAP based

getFractionalItems

public java.util.List getFractionalItems()

Returns a list of items representing the current set of fractional items.

Specified by:
getFractionalItems in interface PercentCalculationsSelectorInterface
Returns:
a list of items representing the current set of fractional items.
Throws:
{@link - java.lang.IllegalStateException} if dataSource is null.

setFractionalItems

public void setFractionalItems(java.util.List items)

Sets the list of items that represent the new set of fractional items.

Specified by:
setFractionalItems in interface PercentCalculationsSelectorInterface

commit

public java.util.Map commit()

Commits the current set of fractional items to this adapter's associated model.

Specified by:
commit in interface SelectorCommitInterface
Throws:
{@link - java.lang.IllegalStateException} if dataSource is null.

getPropertiesBean

public java.lang.Object getPropertiesBean()

Required to satisfy the SelectorCommitInterface but not used in this implementation.

Specified by:
getPropertiesBean in interface SelectorCommitInterface
Returns:
this implementation always returns null.
See Also:
SelectorCommitInterface

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale

Specified by:
setLocale in interface PercentCalculationsSelectorInterface
Parameters:
locale - The locale.

getLocale

public java.util.Locale getLocale()
Returns the locale

Specified by:
getLocale in interface PercentCalculationsSelectorInterface
Returns:
The locale.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.