com.mapinfo.midev.language.filter

## Class LogicalFilter

- java.lang.Object
- - com.mapinfo.midev.language.filter.LogicalFilter

All Implemented Interfaces:
  IFilter

    public final class LogicalFilter
    extends Object
    implements IFilter

A logical filter can be used to combine one or more filters with a logical operator. The logical operator AND evaluates to TRUE if all the combined filters evaluate to TRUE. The logical operator OR evaluates to TRUE if any of the combined filters evaluate to TRUE. The NOT operator reverses the logical value of a filter.

### Constructor Summary

Constructors
Constructor and Description
`LogicalFilter(LogicalOperator logicalOperator, IFilter[] filters)` Create a filter based on the logical of multiple filters.
`LogicalFilter(LogicalOperator logicalOperator, List filters)` Create a filter based on the logical of multiple filters.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static LogicalFilter` `andFilter(IFilter[] filters)` Create a filter based on the logical intersection of multiple filters.
`static LogicalFilter` `andFilter(List filters)` Create a filter based on the logical intersection of multiple filters.
`LogicalOperator` `getLogicalOperator()` Returns the test operation to be performed.
`List` `getOperands()` Returns the list of filter operands.
`boolean` `isSpatial()` Returns `true` if any of the child `IFilters` are spatial; `false` if not.
`static LogicalFilter` `notFilter(IFilter filter)` Create a filter based on the logical negation of the specified filter.
`static LogicalFilter` `orFilter(IFilter[] filters)` Create a filter based on the logical union of multiple filters.
`static LogicalFilter` `orFilter(List filters)` Create a filter based on the logical union of multiple filters.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LogicalFilter

    public LogicalFilter(LogicalOperator logicalOperator,
                         List filters)

Create a filter based on the logical of multiple filters.

Parameters:
  `logicalOperator` - Filter based on this logical operator.
  `filters` - Filter based on the specified operator and these filters.

#### LogicalFilter

    public LogicalFilter(LogicalOperator logicalOperator,
                         IFilter[] filters)

Create a filter based on the logical of multiple filters.

Parameters:
  `logicalOperator` - Filter based on this logical operator.
  `filters` - Filter based on the specified operator and these filters.

### Method Detail

#### getLogicalOperator

    public LogicalOperator getLogicalOperator()

Returns the test operation to be performed.

Returns:
  the test operation to be performed.

#### getOperands

    public List getOperands()

Returns the list of filter operands. Logical operators of AND and OR require at least two operands, however more may be supplied. The NOT operator requires exactly one operand in the list.

Returns:
  the list of filter operands.

#### andFilter

    public static LogicalFilter andFilter(IFilter[] filters)

Create a filter based on the logical intersection of multiple filters.

Parameters:
  `filters` - Filter if all of these filters apply.

#### andFilter

    public static LogicalFilter andFilter(List filters)

Create a filter based on the logical intersection of multiple filters.

Parameters:
  `filters` - Filter if all of these filters apply.

#### orFilter

    public static LogicalFilter orFilter(IFilter[] filters)

Create a filter based on the logical union of multiple filters.

Parameters:
  `filters` - Filter if any of these filters apply.

#### orFilter

    public static LogicalFilter orFilter(List filters)

Create a filter based on the logical union of multiple filters.

Parameters:
  `filters` - Filter if any of these filters apply.

#### notFilter

    public static LogicalFilter notFilter(IFilter filter)

Create a filter based on the logical negation of the specified filter.

Parameters:
  `filter` - Negate this filter.

#### isSpatial

    public boolean isSpatial()

Returns `true` if any of the child `IFilters` are spatial; `false` if not.

Specified by:
  `isSpatial` in interface `IFilter`
Returns:
  `true` if any of the child `IFilters` are spatial; `false` if not.