Class PageTimeComparator

All Implemented Interfaces:, java.util.Comparator<Page>

public class PageTimeComparator
extends java.lang.Object
implements java.util.Comparator<Page>,
Compares the lastModified date of its arguments. Both o1 and o2 MUST be WikiPage objects, or else you will receive a ClassCastException.

If the lastModified date is the same, then the next key is the page name. If the page name is also equal, then returns 0 for equality.

See Also:
Serialized Form
  • Constructor Summary

    Constructor Description
  • Method Summary

    Modifier and Type Method Description
    int compare​(Page p1, Page p2)

    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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
  • Constructor Details

  • Method Details

    • compare

      public int compare​(Page p1, Page p2)
      Specified by:
      compare in interface java.util.Comparator<Page>