Class TLcyCompositeAndFilter<T>

java.lang.Object
com.luciad.lucy.util.ALcyCompositeFilter<T>
com.luciad.lucy.util.TLcyCompositeAndFilter<T>
All Implemented Interfaces:
ILcdChangeSource, ILcdDynamicFilter<T>, ILcdFilter<T>, Serializable, Predicate<T>

public class TLcyCompositeAndFilter<T> extends ALcyCompositeFilter<T>

Implementation of ALcyCompositeFilter that logically ands the associated filters together. This means that accept will only return true if the given object is accepted by all associated filters.

The filters are evaluated in the order in which they were added. This doesn't have any impact on the result, but it might have a performance impact.

See Also:
  • Constructor Details

    • TLcyCompositeAndFilter

      public TLcyCompositeAndFilter()
      Constructs a new TLcyCompositeAndFilter, having no associated ILcdFilters. It will therefore accept every object.
    • TLcyCompositeAndFilter

      @SafeVarargs public TLcyCompositeAndFilter(ILcdFilter<T>... aFilters)
      Constructs a new TLcyCompositeAndFilter populated with aFilters. The filter will only accept objects which are accepted by all filter instances.
      Parameters:
      aFilters - The initial filters to use
      Since:
      2016.1
  • Method Details

    • accept

      public boolean accept(T aObject)

      Returns true if all associated ILcdFilters accept the given Object or if no ILcdFilters are associated. Returns false otherwise.

      The filters are evaluated in order (see ALcyCompositeFilter.getFilter(int)) and false will be returned as soon as the first filter is encountered which does not accept aObject (similar to the && construct of the Java language).

      Parameters:
      aObject - The object to evaluate.
      Returns:
      True if all filters accept the object.
      See Also: