Class Finder.AndFilter

  • Enclosing class:
    Finder

    static class Finder.AndFilter
    extends Finder.Filter
    One of the logical operations of filters: Returns a filter which passes a file iff all original filters in filters do so.

    This is a lazy and-filter, i.e. if one of the filters rejects the file, the filters later in the sequence are not executed any more. So the ordering has an effect, if one of the filters has a side effect. Ordering may also affect performance.

    Maybe lazy and-filters are not so useful, because, unlike non-lazy and-filters and or-filters, they could be realized as a sequence of filters.

    See Finder.and(Filter[]).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Finder.Filter[] filters
      This filter passes a file iff all of these pass if invoked in the natural ordering.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean pass​(java.io.File file)
      Returns for the given file whether this file passes this filter.
      • Methods inherited from class java.lang.Object

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

      • filters

        private final Finder.Filter[] filters
        This filter passes a file iff all of these pass if invoked in the natural ordering.
    • Method Detail

      • pass

        public boolean pass​(java.io.File file)
        Description copied from class: Finder.Filter
        Returns for the given file whether this file passes this filter.
        Specified by:
        pass in class Finder.Filter