Class DleseCollectionFileIndexingWriter.CollectionAccessionStatusComparator

java.lang.Object
org.dlese.dpc.index.writer.DleseCollectionFileIndexingWriter.CollectionAccessionStatusComparator
All Implemented Interfaces:
Comparator
Enclosing class:
DleseCollectionFileIndexingWriter

public static class DleseCollectionFileIndexingWriter.CollectionAccessionStatusComparator extends Object implements Comparator
Allows sorting of a Collection accession status XML Node, by date giving precedence to status = accessioned if dates are equal.
Author:
John Weatherley
  • Constructor Details

    • CollectionAccessionStatusComparator

      public CollectionAccessionStatusComparator()
  • Method Details

    • compare

      public int compare(Object O1, Object O2) throws ClassCastException
      Compares two collection accession XML nodes for sorting.
      Specified by:
      compare in interface Comparator
      Parameters:
      O1 - A collectionStatus dom4j XML Node from a dlese_collect XML Document.
      O2 - A collectionStatus dom4j XML Node from a dlese_collect XML Document.
      Returns:
      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 error.