org.springframework.batch.support
Class LastModifiedResourceComparator

java.lang.Object
  extended by org.springframework.batch.support.LastModifiedResourceComparator
All Implemented Interfaces:
Comparator<Resource>

public class LastModifiedResourceComparator
extends Object
implements Comparator<Resource>

Comparator to sort resources by the file last modified time.

Author:
Dave Syer

Constructor Summary
LastModifiedResourceComparator()
           
 
Method Summary
 int compare(Resource r1, Resource r2)
          Compare the two resources by last modified time, so that a sorted list of resources will have oldest first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

LastModifiedResourceComparator

public LastModifiedResourceComparator()
Method Detail

compare

public int compare(Resource r1,
                   Resource r2)
Compare the two resources by last modified time, so that a sorted list of resources will have oldest first.

Specified by:
compare in interface Comparator<Resource>
Throws:
IllegalArgumentException - if one of the resources doesn't exist or its last modified date cannot be determined
See Also:
Comparator.compare(Object, Object)


Copyright © 2013 SpringSource. All Rights Reserved.