org.apache.uima.pear.util

## Class FileUtil.FileTimeComparator

- java.lang.Object
- - org.apache.uima.pear.util.FileUtil.FileTimeComparator

- All Implemented Interfaces:
    Comparator<File>
  Enclosing class:
    FileUtil

      public static class FileUtil.FileTimeComparator
      extends Object
      implements Comparator<File>

  The `FileTimeComparator` class allows comparing 'last modified' time in 2 given `File` objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileTimeComparator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(File o1, File o2)`
    `boolean` | `equals(Object obj)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### FileTimeComparator

          public FileTimeComparator()

  - ### Method Detail

    - #### compare

          public int compare(File o1,
                             File o2)
                      throws ClassCastException

      Specified by:
        `compare` in interface `Comparator<File>`
      Returns:
        A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
      Throws:
        `ClassCastException` - if the arguments' types prevent them from being compared by this `Comparator`.

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in interface `Comparator<File>`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `obj` - The reference object with which to compare.
      Returns:
        `true` only if the specified object is also a `FileTimeComparator`, and it imposes the same ordering as this comparator.

Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.