1 | package org.apache.tools.ant.types.resources.comparators;↵ | | 1 | package org.apache.tools.ant.types.resources.comparators;↵
|
|
2 | import org.apache.tools.ant.types.Resource;↵ | | 2 | import org.apache.tools.ant.types.Resource;↵
|
|
3 | /**↵ | | 3 | /**↵
|
4 | * Compares Resources by last modification date.↵ | | 4 | * Compares Resources by size.↵
|
5 | * @since Ant 1.7↵ | | 5 | * @since Ant 1.7↵
|
6 | */↵ | | 6 | */↵
|
7 | public class Date extends ResourceComparator {↵ | | 7 | public class Size extends ResourceComparator {↵
|
8 | /**↵ | | 8 | /**↵
|
9 | * Compare two Resources.↵ | | 9 | * Compare two Resources.↵
|
10 | * @param foo the first Resource.↵ | | 10 | * @param foo the first Resource.↵
|
11 | * @param bar the second Resource.↵ | | 11 | * @param bar the second Resource.↵
|
12 | * @return a negative integer, zero, or a positive integer as the first↵ | | 12 | * @return a negative integer, zero, or a positive integer as the first↵
|
13 | * argument is less than, equal to, or greater than the second.↵ | | 13 | * argument is less than, equal to, or greater than the second.↵
|
14 | */↵ | | 14 | */↵
|
15 | protected int resourceCompare(Resource foo, Resource bar) {↵ | | 15 | protected int resourceCompare(Resource foo, Resource bar) {↵
|
16 | return (int) (foo.getLastModified() - bar.getLastModified());↵ | | 16 | return (int) (foo.getSize() - bar.getSize());↵
|
17 | }↵ | | 17 | }↵
|
|
18 | } | | 18 | }
|