org.jutil.io.fileset
Class FilePredicate

java.lang.Object
  |
  +--org.jutil.predicate.AbstractPredicate
        |
        +--org.jutil.io.fileset.FilePredicate
All Implemented Interfaces:
CollectionOperator, Predicate
Direct Known Subclasses:
BaseDirPredicate, LocalDisk

public abstract class FilePredicate
extends AbstractPredicate

A class of predicate meant to check properties of files.

All FilePredicates will return false if the argument passed to eval() is not a File.


Fields inherited from interface org.jutil.predicate.Predicate
CVS_REVISION
 
Constructor Summary
FilePredicate()
           
 
Method Summary
 boolean eval(java.lang.Object object)
          Evaluate this Predicate for the given object.
abstract  boolean evalFile(java.io.File file)
          Evaluate this FilePredicate for the given file
 
Methods inherited from class org.jutil.predicate.AbstractPredicate
count, equals, exists, filter, forall, nbSubPredicates
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jutil.predicate.Predicate
getSubPredicates
 
Methods inherited from interface org.jutil.java.collections.CollectionOperator
isValidElement
 

Constructor Detail

FilePredicate

public FilePredicate()
Method Detail

eval

public boolean eval(java.lang.Object object)
             throws java.lang.Exception
Description copied from interface: Predicate
Evaluate this Predicate for the given object.

Specifications:
     also
public behavior
ensures !(object instanceof File) ==> \result == false;
ensures object instanceof File ==> \result == evalFile((File)object);

Specifications inherited from overridden method in interface Predicate:
public behavior
ensures \result == true|\result == false;
signals (Exception) !isValidElement(object);

evalFile

public abstract boolean evalFile(java.io.File file)
                          throws java.lang.Exception
Evaluate this FilePredicate for the given file

Parameters:
file - The file to evaluate this FilePredicate with

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