Class OrFilter<T>

java.lang.Object
repast.simphony.filter.OrFilter<T>
All Implemented Interfaces:
Filter<T>

public class OrFilter<T> extends Object implements Filter<T>
Filter that evalutes to true if any of its component filters evaluate to true. If the filter is empty, then this also returns true.
Author:
Nick Collier
  • Constructor Details

    • OrFilter

      public OrFilter()
      Creates an empty OrFilter.
    • OrFilter

      public OrFilter(Filter<T>... filters)
      Creates an OrFilter composed of the specified filters.
      Parameters:
      filters - the filters to add
  • Method Details

    • addFilter

      public void addFilter(Filter<T> filter)
      Add the specified filter to this OrFilter.
      Parameters:
      filter - the filter to add
    • filters

      public Iterable<Filter<T>> filters()
      Gets an iterable over the filters that compose this OrFilter.
      Returns:
      an iterable over the filters that compose this OrFilter.
    • evaluate

      public boolean evaluate(T object)
      Specified by:
      evaluate in interface Filter<T>