org.apache.felix.scrplugin.tags
Class JavaClassDescriptionInheritanceComparator

java.lang.Object
  extended by org.apache.felix.scrplugin.tags.JavaClassDescriptionInheritanceComparator
All Implemented Interfaces:
Comparator<JavaClassDescription>

public class JavaClassDescriptionInheritanceComparator
extends Object
implements Comparator<JavaClassDescription>

The JavaClassDescriptionInheritanceComparator orders JavaClassDescription objects by their inheritance:

  1. If the descriptors are the same, zero is returned
  2. If the first descriptor is an extension of the second, 1 is returned
  3. If the second descriptor is an extension of the first, -1 is returned
  4. Otherwise if the first descriptor is nested deeper in the hierarchy 1 is returned, else if the second descriptor is nested deeper in the hierarchy -1 is returned.
  5. Finally, the natural order of the class names is returned


Constructor Summary
JavaClassDescriptionInheritanceComparator()
           
 
Method Summary
 int compare(JavaClassDescription cd1, JavaClassDescription cd2)
           
 
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
 

Constructor Detail

JavaClassDescriptionInheritanceComparator

public JavaClassDescriptionInheritanceComparator()
Method Detail

compare

public int compare(JavaClassDescription cd1,
                   JavaClassDescription cd2)
Specified by:
compare in interface Comparator<JavaClassDescription>


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.