***  This class is subject to change.  ***

com.sas.iquery.metadata.business
Class DataSelectionFactory

com.sas.iquery.metadata.business.DataSelectionFactory

public class DataSelectionFactory

A factory for creating DataSelection objects.

It is the responsibility of the API user to call the dispose() method on a data selection when it is no longer needed. If that method is not called there is no guarantee that it will be garbage collected.

See Also:
Model.dispose()

Constructor Summary
DataSelectionFactory()
           
 
Method Summary
static DataSelection newDataSelection(BusinessModel businessModel)
          Creates and returns a new DataSelection object based upon the given business model.
static DataSelection newSampleDataSelection(BusinessModel rootBusinessModel, java.util.Map maxElements)
          This method is similar to the default DataSelectionFactory method except that it automatically adds ResultItems to create a sample.
 

Constructor Detail

DataSelectionFactory

public DataSelectionFactory()
Method Detail

newDataSelection

public static DataSelection newDataSelection(BusinessModel businessModel)
Creates and returns a new DataSelection object based upon the given business model.

See the class level javadoc for this class for information on how to ensure garbage collection of unused data selections.

Parameters:
businessModel - an in-memory BusinessModel object. For creating DataSelections based upon their persisted form see readDataSelection().
Returns:
a new DataSelection object based upon the given business model. BusinessItems can be created in the DataSelection based on business items in the given business model.

newSampleDataSelection

public static DataSelection newSampleDataSelection(BusinessModel rootBusinessModel,
                                                   java.util.Map maxElements)
                                            throws MetadataException
This method is similar to the default DataSelectionFactory method except that it automatically adds ResultItems to create a sample. The number of ResultItems can be controlled by the maxDataItemsToUse Map. Only DataItems will be used from the BusinessModel, and these will be used in the order in which they are stored in the BusinessModel. If a DataItem can't be added it will be skipped.

Parameters:
rootBusinessModel - This is the BusinessModel from which the BusinessQuery will be created. Often this BusinessModel will represent an information map.
maxElements - This is a Map which allows the maximum number of elements to be configured. The key can be any of the valid StructureOfDataItem types. The value is an Integer indicating the maximum number of DataItems of that type to be included in the BusinessQuery. A value of -1 indicates that all DataItems with the specified Structure will be included.

See the class level javadoc for this class for information on how to ensure garbage collection of unused data selections.

Returns:
The sample DataSelection that has been created.
Throws:
MetadataException

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.