All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Query |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.iquery.metadata.business
Interface FilterItem

All Superinterfaces:
  AssociationItem, Base, BusinessItem, BusinessModelObject, BusinessModelResource, BusinessModelResourceReferencer, CascadableFilter, java.lang.Cloneable, java.util.EventListener, ExtendedAttributes, FilterCascadeContainer, LocalizableModelObject, LocalizableNamedObjectInterface, com.sas.util.LocalizableToStringInterface, ModelItem, ModelItemWithIdentity, NamedObjectInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, UsabilityInterface

All Known Subinterfaces:
  CompoundFilter

    public interface FilterItem

extends BusinessItem, ModelItemWithIdentity, LocalizableModelObject, CascadableFilter, FilterCascadeContainer, AssociationItem

Contains a single conditional expression which is used to filter data when running a query and typically yields a result set containing less data.

Often, this conditional expression takes the form <<data item>> - <<operator>> - <<constant>>, for example PRICE >= 150.0. It does not provide data in the result set. It specifies which result set rows are returned based on the filtering criteria.

As with the composition of a data item's expression, the expression that makes up a FilterItem must directly or indirectly be based upon data sources defined in the business model chain that the filter is contained in. For example, any columns used in the filter definition whether directly or indirectly through data item definitions, must be associated with (owned by) tables for which there exist data source definitions somewhere in the business model chain.

Unless otherwise noted, all getter/setter method pairs do not copy their outputs or inputs, respectively. That is, if one calls the setter method and immediately calls the getter method for that same attribute, the object that was just given on the setter method will be returned by the getter. The only general exception to this rule, which is not documented further on the getter/setter methods, is when the output or input is a List, in which case the List is copied but the contents of the list are not copied. (A shallow copy of the List is made in both the setter and getter methods).

See Also:
  `CompoundFilter`, `CompoundConditionalExpression`

Field Summary
`static java.lang.String` | `EVENT_FILTER_EXPRESSION_CHANGED` Indication that the filter expression has been changed.

Fields inherited from interface com.sas.iquery.metadata.business.ModelItemWithIdentity
`EVENT_DESCRIPTION_CHANGED, EVENT_HIDDEN_CHANGED, EVENT_ID_CHANGED, EVENT_LABEL_CHANGED`

Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
`EVENT_OBJECT_PROPERTY_CHANGED`

Fields inherited from interface com.sas.iquery.metadata.business.Base
`EVENT_OBJECT_DEFINITION_CHANGED`

Fields inherited from interface com.sas.iquery.metadata.business.LocalizableModelObject
`EVENT_LOCALIZABLE_DESCRIPTIONS_CHANGED, EVENT_LOCALIZABLE_LABELS_CHANGED`

Method Summary
`java.util.List<DataItem>` | `getDataItems(int searchCriteria)` Provides a way for consumer to determine what DataItems a given filter may have on it.
`ExpressionInterface` | `getExpression()` Gets the filter's conditional expression.
`java.util.List<Prompt>` | `getPrompts(int searchCriteria)` A utility function for returning the list of prompts used (directly or indirectly) in in the definition of this filter.
`void` | `setExpression(ExpressionInterface condExpr)` Sets the filter's conditional expression to be the given expression.

Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelObject
`getBusinessModel, isContainedInBusinessModel, isIDOK, isReadOnly`

Methods inherited from interface com.sas.iquery.metadata.business.ModelItemWithIdentity
`getID, getIdentityString, getIntraModelID, isHidden, isUnresolved, setDescription, setIntraModelID, setIsHidden, setLabel`

Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
`addListener, getListeners, removeListener`

Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
`getReasonsUnusable, isUsableInQuery`

Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResource
`isUnresolved`

Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
`getResources`

Methods inherited from interface com.sas.iquery.metadata.business.ExtendedAttributes
`getExtendedAttributes, setExtendedAttributes`

Methods inherited from interface com.sas.iquery.metadata.business.LocalizableModelObject
`getLocalizableProperties, getLocalizationPrependKey, setDescription, setDescriptions, setLabel, setLabels, setLocalizableProperties`

Methods inherited from interface com.sas.iquery.metadata.LocalizableNamedObjectInterface
`getDescription, getDescriptions, getLabel, getLabels`

Methods inherited from interface com.sas.iquery.metadata.NamedObjectInterface
`getDescription, getLabel`

Methods inherited from interface com.sas.iquery.metadata.business.FilterCascadeContainer
`getCascades`

Field Detail

### EVENT_FILTER_EXPRESSION_CHANGED

    static final java.lang.String EVENT_FILTER_EXPRESSION_CHANGED

  Indication that the filter expression has been changed.

  See Also:
    Constant Field Values

Method Detail

### getExpression

    ExpressionInterface getExpression()

  Gets the filter's conditional expression.

  Specified by:
    `getExpression` in interface `CascadableFilter`
  Returns:
    The filter's expression.

### setExpression

    void setExpression(ExpressionInterface condExpr)
                       throws MetadataException

  Sets the filter's conditional expression to be the given expression.

  Parameters:
    `condExpr` - the filter's expression.
  Throws:
    `MetadataNotChangeableException` - if this object is read-only
    `MetadataException`

### getPrompts

    java.util.List<Prompt> getPrompts(int searchCriteria)

  A utility function for returning the list of prompts used (directly or indirectly) in in the definition of this filter. That is, a recursive search can be made on this filter's expression to return any prompts used within its recursive definition. A search criteria parameter is provided to control the search. The search criteria controls whether data items that make up the recursive definition of this filter are to be searched for prompts in their recursive definitions ... and if this is a compound filter, whether subfilters that make up the recursive definition of this filter are to be searched for prompts in their recursive definitions.

  Parameters:
    `searchCriteria` - defines the search criteria for this method. These flags are found in com.sas.meta.business.BusinessModel.

    The following flags are valid for this method and can be OR'd together to combine behaviors:

    - SEARCH_NONRECURSIVELY - specifying this flag causes this method to return only the prompts in this filter's definition ... not recursively asking any data items or subfilters for prompts used in their recursive definitions.
    - SEARCH_THRU_SUBFILTERS - specifying this flag causes this method to return the prompts for this filter as well as prompts for any sub-filters used in the recursive definition of this filter. This flag is only meaningful when this filter is a compound filter. Specifying this flag when not a compound filter is not harmful, it just doesn't do anything.
    - SEARCH_THRU_SUBDATAITEMS - specifying this flag causes this method to return the prompts for this filter as well as prompts for any data items used in the recursive definition of this filter's expression.
    - SEARCH_THRU_ALL - specifying this flag causes this method to return all prompts used in the recursive definition of this filter's expression. All data items and subfilters found in the recursive definition of this filter's expression are searched for prompts making up their definitions.

    Usage examples:

    Determining whether a filter has prompts only on the immediate filter and no filters that make up the filter:

          List prompts = filterItem.getPrompts(BusinessModel.SEARCH_NONRECURSIVELY);
          if ( prompts.size() > 0 ) {
              // has prompts
          }

    Determining whether a filter has prompts on the immediate filter and filters that make up the filter:

          List prompts = filterItem.getPrompts(BusinessModel.SEARCH_THRU_SUBFILTERS);
          if ( prompts.size() > 0 ) {
              // has prompts
          }

    Determining whether a filter has prompts on the immediate filter and data items that make up the filter:

          List prompts = filterItem.getPrompts(BusinessModel.SEARCH_THRU_SUBDATAITEMS);
          if ( prompts.size() > 0 ) {
              // has prompts
          }

  Returns:
    A list of prompts. If the list size is zero, there are no prompts.

### getDataItems

    @Nonnull
    java.util.List<DataItem> getDataItems(int searchCriteria)

  Provides a way for consumer to determine what DataItems a given filter may have on it. Returns a list of data items that are set on the filter.

  Parameters:
    `searchCriteria` - defines the search criteria for this method. These flags are found in com.sas.meta.business.BusinessModel.

    The following flags are valid for this method and can be OR'd together to combine behaviors:

    - SEARCH_NONRECURSIVELY - specifying this flag causes this method to return only the DataItems for this filter. No other DataItems from filters that make up the current filter will be returned.
    - SEARCH_THRU_SUBFILTERS - specifying this flag causes this method to return the DataItems for this filter as well as DataItems for any filters that make up this filter.
    - SEARCH_THRU_SUBDATAITEMS - specifying this flag causes this method to return the DataItems for this filter as well as DataItems for any data items that are part of this filter.
    - SEARCH_THRU_ALL - specifying this flag causes this method to return the DataItems for this filter as well as DataItems for any items that are part of this filter.

    Usage examples:

    Determining whether a filter has data items only on the immediate filter and no filters that make up the filter:

          List dataItems = filterItem.getDataItems(BusinessModel.SEARCH_NONRECURSIVELY);
          if ( dataItems.size() > 0 ) {
              // has data items
          }

    Determining whether a filter has DataItems on the immediate filter and filters that make up the filter:

          List dataItems = filterItem.getDataItems(BusinessModel.SEARCH_THRU_SUBFILTERS);
          if ( dataItems.size() > 0 ) {
              // has data items
          }

    Determining whether a filter has DataItems on the immediate filter and data items that make up the filter:

          List dataItems = filterItem.getDataItems(BusinessModel.SEARCH_THRU_SUBDATAITEMS);
          if ( dataItems.size() > 0 ) {
              // has data items
          }

    Determining whether a filter has any DataItems on itself or its descendants:

          List dataItems = filterItem.getDataItems(BusinessModel.SEARCH_THRU_ALL);
          if ( dataItems.size() > 0 ) {
              // has data items
          }

  Returns:
    A list of data items. If the list size is zero, there are no data items.

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Query |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.