***  This interface is subject to change.  ***

com.sas.iquery.metadata.business
Interface CompoundFilter

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

public interface CompoundFilter
extends FilterItem, FilterCascadeContainerUpdater

Specifies a filter that is definedin terms of other separately defined filters. That allows one to define arbitrarily complex filters (based on other separate filters) with the logical operators AND and OR.

Example:

Given:

DataItem1 = Table.ColumnX

DataItem2 = Table.ColumnY

FilterItemA = 5 > DataItem1

FilterItemB = DataItem2 > 7 AND DataItem2 <= 10

Valid CompoundFilters:

1) CF1 = FIA

CompoundFilter compound1 = BusinessModel.newCompoundFilter();

compound.setLeftFilter(FilterItemA);

2) CF2 = !FIB

ompoundFilter compound2 = BusinessModel.newCompoundFilter();

compound.setLeftFilter(FilterItemB);

compound.setIsNegated(true);

3) CF3 = !(FIA AND FIB)

CompoundFilter compound3 = BusinessModel.newCompoundFilter();

compound.setLeftFilter(FilterItemA);

compound.setRelationType(ConditionalRelationType.AND);

compound.setRightFilter(FilterItemB);

compound.setIsNegated(true);

4) CF4 = FIA AND FIB

CompoundFilter compound4 = BusinessModel.newCompoundFilter();

compound.setLeftFilter(FilterItemA);

compound.setRelationType(ConditionalRelationType.AND);

compound.setRightFilter(FilterItemB);

5) CF5 = CF1 OR CF2

CompoundFilter compound5 = BusinessModel.newCompoundFilter();

compound.setLeftFilter(compound1);

compound.setRelationType(ConditionalRelationType.OR);

compound.setRightFilter(compound2);

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


Field Summary
 
Fields inherited from interface com.sas.iquery.metadata.business.FilterItem
EVENT_FILTER_EXPRESSION_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
 FilterItem getLeftFilter()
          Gets the left hand operand of the compound filter expression
 ConditionalRelationType getRelationType()
          Gets the relation type for the expression.
 FilterItem getRightFilter()
          Return the right hand side of the compound filter expression.
 boolean isNegated()
          Returns true is the compound filter is negated.
 void setIsNegated(boolean flag)
          Defaults to false.
 void setLeftFilter(FilterItem lhs)
          Sets the left hand operand of the compound filter expression
 void setRelationType(ConditionalRelationType relationType)
          Sets the relation type with a value from class ConditionalRelationType
 void setRightFilter(FilterItem rhs)
          Sets the right hand operand of the compound filter expression
 
Methods inherited from interface com.sas.iquery.metadata.business.FilterItem
getDataItems, getExpression, getPrompts, setExpression
 
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.NamedObjectInterface
getDescription, getLabel
 
Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
getResources
 
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.business.FilterCascadeContainerUpdater
setCascades
 
Methods inherited from interface com.sas.iquery.metadata.business.FilterCascadeContainer
getCascades
 

Method Detail

***  This method is subject to change.  ***

getRelationType

ConditionalRelationType getRelationType()
Gets the relation type for the expression.

Returns:
relation type from the values (AND,OR) in class ConditionalRelationType

***  This method is subject to change.  ***

setRelationType

void setRelationType(ConditionalRelationType relationType)
Sets the relation type with a value from class ConditionalRelationType

Parameters:
relationType -

***  This method is subject to change.  ***

setLeftFilter

void setLeftFilter(FilterItem lhs)
Sets the left hand operand of the compound filter expression

Parameters:
lhs - Filter to use as the left filter.
Throws:
MetadataNotChangeableException - if the compound filter is read-only
See Also:
getLeftFilter()

***  This method is subject to change.  ***

getLeftFilter

FilterItem getLeftFilter()
Gets the left hand operand of the compound filter expression

Returns:
the left hand side of the compound filter expression.
See Also:
setLeftFilter(FilterItem)

***  This method is subject to change.  ***

setRightFilter

void setRightFilter(FilterItem rhs)
Sets the right hand operand of the compound filter expression

Parameters:
rhs - Filter to use as the right filter.
Throws:
MetadataNotChangeableException - if the compound filter is read-only
See Also:
getRightFilter()

***  This method is subject to change.  ***

getRightFilter

FilterItem getRightFilter()
Return the right hand side of the compound filter expression.

Returns:
the filter on the right hand side of this compound filter
See Also:
setRightFilter(FilterItem rhs)

***  This method is subject to change.  ***

isNegated

boolean isNegated()
Returns true is the compound filter is negated.

Returns:
true if the compound filter is negate. Otherwise false.
See Also:
setIsNegated(boolean)

***  This method is subject to change.  ***

setIsNegated

void setIsNegated(boolean flag)
Defaults to false.

Parameters:
flag - indicating if this filter is negated
Throws:
MetadataNotChangeableException - if this object is read-only
See Also:
isNegated()

***  This interface is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.