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:
java.util.Comparator<Doc>
- Enclosing class:
- Utils
abstract static class Utils.DocComparator<T extends Doc> extends java.lang.Object implements java.util.Comparator<Doc>
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 Modifier and Type Class Description (package private) static classUtils.DocComparator.DocKind
-
Constructor Summary
Constructors Constructor Description DocComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcompareDocKinds(Doc d1, Doc d2)Compares two Doc entities' kinds, and these are ordered as defined in the DocKind enumeration.protected intcompareFullyQualifiedNames(Doc d1, Doc d2)Compares the fully qualified names of the entitiesprotected intcompareNames(Doc d1, Doc d2)Compares two Doc entities typically the simple name of a method, field, constructor etc.protected intcompareParameters(boolean caseSensitive, Parameter[] params1, Parameter[] params2)Compares arrays of parameters as a string representation of their types.(package private) Utils.DocComparator.DocKindgetDocKind(Doc d)protected java.lang.StringgetParametersAsString(Parameter[] params)(package private) booleanhasParameters(Doc d)
-
-
-
Method Detail
-
hasParameters
boolean hasParameters(Doc d)
-
getDocKind
Utils.DocComparator.DocKind getDocKind(Doc d)
-
compareDocKinds
protected int compareDocKinds(Doc d1, Doc d2)
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
protected int compareParameters(boolean caseSensitive, Parameter[] params1, Parameter[] params2)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
protected java.lang.String getParametersAsString(Parameter[] params)
-
compareNames
protected int compareNames(Doc d1, Doc d2)
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
protected int compareFullyQualifiedNames(Doc d1, Doc d2)
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.
-
-