Class JJDocMojo.GrammarInfoComparator

  • All Implemented Interfaces:
    java.util.Comparator
    Enclosing class:
    JJDocMojo

    private static class JJDocMojo.GrammarInfoComparator
    extends java.lang.Object
    implements java.util.Comparator
    Compares grammar infos using their relative grammar file paths as the sort key.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object o1, java.lang.Object o2)
      Compares the path of two grammar files lexicographically.
      static JJDocMojo.GrammarInfoComparator getInstance()
      Gets the singleton instance of this class.
      • 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 Detail

      • GrammarInfoComparator

        private GrammarInfoComparator()
    • Method Detail

      • getInstance

        public static JJDocMojo.GrammarInfoComparator getInstance()
        Gets the singleton instance of this class.
        Returns:
        The singleton instance of this class.
      • compare

        public int compare​(java.lang.Object o1,
                           java.lang.Object o2)
        Compares the path of two grammar files lexicographically.
        Specified by:
        compare in interface java.util.Comparator
        Parameters:
        o1 - The first grammar info.
        o2 - The second grammar info.
        Returns:
        A negative integer if the first grammar is considered "smaller", a positive integer if it is considered "greater" and zero otherwise.