terp - the ANT Tasks
v1.3.304

com.codemesh.terp.ant.compiler
Class DependencyChecker

java.lang.Object
  extended by com.codemesh.terp.ant.compiler.DependencyChecker

public class DependencyChecker
extends java.lang.Object

A utility class that checks whether files are up-to-date based on last-modified timestamps of dependencies.


Constructor Summary
DependencyChecker()
           
DependencyChecker(long diff)
           
 
Method Summary
 void addDependency(java.io.File target, java.io.File... sources)
          Adds one more more file dependecies to the checker.
 java.util.Set<java.io.File> getDependencies(java.io.File target)
           
 long getEffectiveLastModified(java.io.File target)
          Returns the effective modification time by taking the modification times of inputs into account.
 long getLastModified(java.io.File file)
          A method reducing file system accesses by using the cached file modification time maintained by the dependency checker.
 boolean isUpToDate(java.io.File target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyChecker

public DependencyChecker()

DependencyChecker

public DependencyChecker(long diff)
Method Detail

addDependency

public void addDependency(java.io.File target,
                          java.io.File... sources)
Adds one more more file dependecies to the checker.

Parameters:
target - the target file.
sources - the source files on which target depends.

getDependencies

public java.util.Set<java.io.File> getDependencies(java.io.File target)

isUpToDate

public boolean isUpToDate(java.io.File target)

getLastModified

public long getLastModified(java.io.File file)
A method reducing file system accesses by using the cached file modification time maintained by the dependency checker.

Parameters:
file - the file whose modification time we want to know.
Returns:
the modification time.

getEffectiveLastModified

public long getEffectiveLastModified(java.io.File target)
Returns the effective modification time by taking the modification times of inputs into account. The "effective modification time" is the largest modification timestamp of all files on which the file of interest depends. A file is out-of-date if "effective modification time" > "modification time"

Parameters:
target - the dependent file.
Returns:

terp - the ANT Tasks
v1.3.304

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.