Class Utils.DocComparator<T extends Doc>
java.lang.Object
gw.gosudoc.com.sun.tools.doclets.internal.toolkit.util.Utils.DocComparator<T>
- Type Parameters:
T
- a Doc entity
- All Implemented Interfaces:
Comparator<Doc>
- Enclosing class:
- Utils
A general purpose comparator to sort Doc entities, basically provides the building blocks
for creating specific comparators for an use-case.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareDocKinds
(Doc d1, Doc d2) Compares two Doc entities' kinds, and these are ordered as defined in the DocKind enumeration.protected int
compareFullyQualifiedNames
(Doc d1, Doc d2) Compares the fully qualified names of the entitiesprotected int
compareNames
(Doc d1, Doc d2) Compares two Doc entities typically the simple name of a method, field, constructor etc.protected int
compareParameters
(boolean caseSensitive, Parameter[] params1, Parameter[] params2) Compares arrays of parameters as a string representation of their types.(package private) Utils.DocComparator.DocKind
getDocKind
(Doc d) protected String
getParametersAsString
(Parameter[] params) (package private) boolean
hasParameters
(Doc d) 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
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DocComparator
DocComparator()
-
-
Method Details
-
hasParameters
-
getDocKind
-
compareDocKinds
Compares two Doc entities' kinds, and these are ordered as defined in the DocKind enumeration.- Parameters:
d1
- the first Doc objectd2
- the second Doc object- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
compareParameters
Compares arrays of parameters as a string representation of their types.- Parameters:
ignoreCase
- specifies case sensitive or insensitive comparison.params1
- the first parameter array.params2
- the first parameter array.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
getParametersAsString
-
compareNames
Compares two Doc entities typically the simple name of a method, field, constructor etc.- Parameters:
d1
- the first Doc.d2
- the second Doc.- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-
compareFullyQualifiedNames
Compares the fully qualified names of the entities- Parameters:
d1
- the first entityd2
- the second entity- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
-