Class OrFilter

  • All Implemented Interfaces:
    Filter

    public class OrFilter
    extends java.lang.Object
    implements Filter
    Creates a filter that matches if at least one of the sub-filters is a match. Respects the rules of IndexedFilter as well
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList<Filter> allFilters  
    • Constructor Summary

      Constructors 
      Constructor Description
      OrFilter​(Filter... filters)
      Creates an OrFilter whose matches methods returns true if at least one of the filters given returns true.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(Descriptor d)
      Returns true if this filter matches the given object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • allFilters

        private final java.util.ArrayList<Filter> allFilters
    • Constructor Detail

      • OrFilter

        public OrFilter​(Filter... filters)
        Creates an OrFilter whose matches methods returns true if at least one of the filters given returns true. If filters is zero length then the matches method will always return false because none of the filters returned true!
        Parameters:
        filters - other filters to be considered in the Or expression
    • Method Detail

      • matches

        public boolean matches​(Descriptor d)
        Description copied from interface: Filter
        Returns true if this filter matches the given object
        Specified by:
        matches in interface Filter
        Parameters:
        d - The object to match against this filter. May not be null
        Returns:
        true if this filter matches the object