Class JJDocMojo.GrammarInfoComparator

java.lang.Object
org.codehaus.mojo.javacc.JJDocMojo.GrammarInfoComparator
All Implemented Interfaces:
Comparator
Enclosing class:
JJDocMojo

private static class JJDocMojo.GrammarInfoComparator extends Object implements Comparator
Compares grammar infos using their relative grammar file paths as the sort key.
  • Field Details

  • Constructor Details

    • GrammarInfoComparator

      private GrammarInfoComparator()
  • Method Details

    • getInstance

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

      public int compare(Object o1, Object o2)
      Compares the path of two grammar files lexicographically.
      Specified by:
      compare in interface 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.