Class ClassArraySorter

java.lang.Object
org.bzdev.util.ClassArraySorter

public class ClassArraySorter extends Object
Sort class arrays in a standard order. The ordering is such that for each array index, a given class will appear before its superclasses and before the interfaces it implements. Similarly interfaces will appear before the interfaces they extend. Arrays that contain the same class for array index 0 will be adjacent in the sorted order. For an index j, if arrays are selected so that the classes for each index smaller than j match, and if these arrays are kept in the same order, then for these selected arrays, all arrays with the same class at index j will be adjacent.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Table mapping strings to integers.
    static class 
    Class providing a key representing an array of classes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Constant used to denote that an argument count array entry should match any interface.
    static final int
    Constant used to denote that an argument count array entry should be ignored.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a Key.
    Create a list of class arrays ordered so that for a class array ca appearing after a class array ca1, then for all indices i such that ca[j] = ca1[j] when j < i, ca1[i].isAssignableFrom(ca[i]) returns false unless ca[i] = ca1[i].
    createList(boolean remember)
    Create a list of class arrays ordered so that for a class array ca appearing after a class array ca1, then for all indices i such that ca[j] = ca1[j] when j < i, ca1[i].isAssignableFrom(ca[i]) returns false unless ca[i] = ca1[i], optionally remembering the list.
    Get the comparator used to compare class arrays.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait