|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompoundFilter
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 |
---|
ConditionalRelationType getRelationType()
void setRelationType(ConditionalRelationType relationType)
relationType
- void setLeftFilter(FilterItem lhs)
lhs
- Filter to use as the left filter.
MetadataNotChangeableException
- if the compound filter is read-onlygetLeftFilter()
FilterItem getLeftFilter()
setLeftFilter(FilterItem)
void setRightFilter(FilterItem rhs)
rhs
- Filter to use as the right filter.
MetadataNotChangeableException
- if the compound filter is read-onlygetRightFilter()
FilterItem getRightFilter()
setRightFilter(FilterItem rhs)
boolean isNegated()
setIsNegated(boolean)
void setIsNegated(boolean flag)
flag
- indicating if this filter is negated
MetadataNotChangeableException
- if this object is read-onlyisNegated()
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |