Class AbstractFilePredicate

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int DEFAULT_PRIORITY  
      protected static int USE_INDEX  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(OptimizedFilePredicate o)  
      java.lang.Iterable<org.sonar.api.batch.fs.InputFile> filter​(java.lang.Iterable<org.sonar.api.batch.fs.InputFile> target)
      Filter provided files to keep only the ones that are valid for this predicate
      java.lang.Iterable<org.sonar.api.batch.fs.InputFile> get​(org.sonar.api.batch.fs.FileSystem.Index index)
      Get all files that are valid for this predicate.
      int priority()
      For optimization.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.sonar.api.batch.fs.FilePredicate

        apply
    • Constructor Detail

      • AbstractFilePredicate

        public AbstractFilePredicate()
    • Method Detail

      • filter

        public java.lang.Iterable<org.sonar.api.batch.fs.InputFile> filter​(java.lang.Iterable<org.sonar.api.batch.fs.InputFile> target)
        Description copied from interface: OptimizedFilePredicate
        Filter provided files to keep only the ones that are valid for this predicate
        Specified by:
        filter in interface OptimizedFilePredicate
      • get

        public java.lang.Iterable<org.sonar.api.batch.fs.InputFile> get​(org.sonar.api.batch.fs.FileSystem.Index index)
        Description copied from interface: OptimizedFilePredicate
        Get all files that are valid for this predicate.
        Specified by:
        get in interface OptimizedFilePredicate
      • priority

        public int priority()
        Description copied from interface: OptimizedFilePredicate
        For optimization. FilePredicates will be applied in priority order. For example when doing p.and(p1, p2, p3) then p1, p2 and p3 will be applied according to their priority value. Higher priority value are applied first. Assign a high priority when the predicate will likely highly reduce the set of InputFiles to filter. Also RelativePathPredicate and AbsolutePathPredicate have a high priority since they are using cache index.
        Specified by:
        priority in interface OptimizedFilePredicate