Package org.sonar.api.batch.fs.internal
Class AbstractFilePredicate
- java.lang.Object
-
- org.sonar.api.batch.fs.internal.AbstractFilePredicate
-
- All Implemented Interfaces:
java.lang.Comparable<OptimizedFilePredicate>,FilePredicate,OptimizedFilePredicate
- Direct Known Subclasses:
FileExtensionPredicate,FilenamePredicate,RelativePathPredicate,StatusPredicate
public abstract class AbstractFilePredicate extends java.lang.Object implements OptimizedFilePredicate
Partial implementation ofOptimizedFilePredicate.- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_PRIORITYprotected static intUSE_INDEX
-
Constructor Summary
Constructors Constructor Description AbstractFilePredicate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(OptimizedFilePredicate o)java.lang.Iterable<InputFile>filter(java.lang.Iterable<InputFile> target)Filter provided files to keep only the ones that are valid for this predicatejava.lang.Iterable<InputFile>get(FileSystem.Index index)Get all files that are valid for this predicate.intpriority()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
-
-
-
-
Field Detail
-
DEFAULT_PRIORITY
protected static final int DEFAULT_PRIORITY
- See Also:
- Constant Field Values
-
USE_INDEX
protected static final int USE_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
filter
public java.lang.Iterable<InputFile> filter(java.lang.Iterable<InputFile> target)
Description copied from interface:OptimizedFilePredicateFilter provided files to keep only the ones that are valid for this predicate- Specified by:
filterin interfaceOptimizedFilePredicate
-
get
public java.lang.Iterable<InputFile> get(FileSystem.Index index)
Description copied from interface:OptimizedFilePredicateGet all files that are valid for this predicate.- Specified by:
getin interfaceOptimizedFilePredicate
-
priority
public int priority()
Description copied from interface:OptimizedFilePredicateFor 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. AlsoRelativePathPredicateand AbsolutePathPredicate have a high priority since they are using cache index.- Specified by:
priorityin interfaceOptimizedFilePredicate
-
compareTo
public final int compareTo(OptimizedFilePredicate o)
- Specified by:
compareToin interfacejava.lang.Comparable<OptimizedFilePredicate>
-
-