org.jutil.io.fileset
Interface FileSetPredicate

All Superinterfaces:
CollectionOperator, Predicate
All Known Implementing Classes:
LocalDisk, PatternPredicate

public interface FileSetPredicate
extends Predicate

A special class of predicates that allow a FileSet to work efficiently.

A FileSetPredicate allows a FileSet to limit the set of directories to process. It accomplishes this by allowing the FileSetPredicate to suggest a list of directories which will certainly contain all files that will evaluate to true for the predicate. It also provides a method for checking if a certain directory can contain files that evaluate to true.


Fields inherited from interface org.jutil.predicate.Predicate
CVS_REVISION
 
Method Summary
abstract  boolean enterDirectory(java.io.File directory)
          Check whether or not the given directory can contain files which make this predicate evaluate to true.
abstract  java.util.List suggestDirectories()
          Suggest a list of directories which can contain files that will evaluate to true for this FilePredicate. All files that can make this FilePredicate true will be in one of the returned directories.
 
Methods inherited from interface org.jutil.predicate.Predicate
count, equals, eval, exists, filter, forall, getSubPredicates, nbSubPredicates
 
Methods inherited from interface org.jutil.java.collections.CollectionOperator
isValidElement
 

Method Detail

suggestDirectories

public abstract java.util.List suggestDirectories()

Suggest a list of directories which can contain files that will evaluate to true for this FilePredicate.

All files that can make this FilePredicate true will be in one of the returned directories.

Specifications:
public behavior
ensures \result != null;
ensures ( \forall Object o; Collections.containsExplicitly(\result ,o); (o instanceof File)&&((File)o).isDirectory());

enterDirectory

public abstract boolean enterDirectory(java.io.File directory)
Check whether or not the given directory can contain files which make this predicate evaluate to true.

Parameters:
directory - The directory to be checked

Specifications:
public behavior
requires directory != null;
ensures \result == true|\result == false;