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 int
DEFAULT_PRIORITY
protected static int
USE_INDEX
-
Constructor Summary
Constructors Constructor Description AbstractFilePredicate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(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.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
-
-
-
-
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:OptimizedFilePredicate
Filter provided files to keep only the ones that are valid for this predicate- Specified by:
filter
in interfaceOptimizedFilePredicate
-
get
public java.lang.Iterable<InputFile> get(FileSystem.Index index)
Description copied from interface:OptimizedFilePredicate
Get all files that are valid for this predicate.- Specified by:
get
in interfaceOptimizedFilePredicate
-
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. AlsoRelativePathPredicate
and AbsolutePathPredicate have a high priority since they are using cache index.- Specified by:
priority
in interfaceOptimizedFilePredicate
-
compareTo
public final int compareTo(OptimizedFilePredicate o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<OptimizedFilePredicate>
-
-