org.eclipse.higgins.idas.api
Interface IFilter


public interface IFilter

A filter is either an assertion, or an operator plus a set of filters.

For example, the filter ((a=b) && (c=d)) || (e=f) would be constructed as follows:
- Build three IFilterAssertions, one each for a=b, c=d, and e=f
- Build three IFilters, each containing one of the three IFilterAssertions
- Build an IFilter containing the && operator and the first previous IFilters (a=b and c=d)
- Build the final IFilter containing the || operator the previous filter, and the e=f filter

TODO (Doc): Add rules for UNDEFINED state.


Field Summary
static String OP_AND
          When set as the operator, the filter is TRUE when all IFilters are TRUE, otherwise FALSE.
static String OP_NOT
          When set as the operator, the filter is TRUE when the IFilter is FALSE, FALSE when the IFilter is TRUE.
static String OP_OR
          When set as the operator, the filter is TRUE when any IFilter is TRUE, otherwise FALSE.
 
Method Summary
 void addFilter(IFilter filter)
          Adds a filter to the set of filters.
 void addFilter(IFilterAssertion filterAssertion)
          Adds a filter containing the passed IFilterAssertion.
 void setAssertion(IFilterAssertion assertion)
          When this is called, addFilter(IFilter) and setOperator(String) may not be called.
 void setOperator(String operator)
           
 

Field Detail

OP_AND

public static final String OP_AND
When set as the operator, the filter is TRUE when all IFilters are TRUE, otherwise FALSE.

At least two IFilters are required to be added via addFilter(IFilter) Value: "urn:eclipse.higgins.idas.OP_AND"

See Also:
Constant Field Values

OP_OR

public static final String OP_OR
When set as the operator, the filter is TRUE when any IFilter is TRUE, otherwise FALSE.

At least two IFilters are required to be added via addFilter(IFilter) Value: "urn:eclipse.higgins.idas.OP_OR"

See Also:
Constant Field Values

OP_NOT

public static final String OP_NOT
When set as the operator, the filter is TRUE when the IFilter is FALSE, FALSE when the IFilter is TRUE.

Exactly one IFilter is required to be added via addFilter(IFilter) Value: "urn:eclipse.higgins.idas.OP_NOT"

See Also:
Constant Field Values
Method Detail

setAssertion

public void setAssertion(IFilterAssertion assertion)
                  throws IdASException
When this is called, addFilter(IFilter) and setOperator(String) may not be called.

Throws:
IdASException

setOperator

public void setOperator(String operator)
                 throws IdASException
Parameters:
operator - a logical operator (one of OP_AND, OP_OR, or OP_NOT)
Throws:
IdASException

addFilter

public void addFilter(IFilter filter)
               throws IdASException
Adds a filter to the set of filters. The number of filters added depends on the operator. See OP_AND, OP_OR, and OP_NOT

Throws:
IdASException

addFilter

public void addFilter(IFilterAssertion filterAssertion)
               throws IdASException
Adds a filter containing the passed IFilterAssertion.

Throws:
IdASException