All Packages Class Hierarchy This Package Previous Next Index
Object | +----com.symantec.itools.vcafe.sort.PartialOrder
Call sort() to partially order an array of objects based on either a PartialOrder.Relation or an array of PartialOrder.Precedes.
sort() returns an array of Object such that for any two elements at indices i,j, if a[i] precedes a[j] then i < j. The input array is not modified.
If the relation is cyclic in the input array, the output array is returned partially filled. The missing array elements participate in one or more cycles.
For example, for an array of Class objects and a precedes method defined by (Class)a instanceof (Class)b && !a.equals(b), in the returned array subclasses precede base classes.
public PartialOrder()
public static java.lang.Object[] sort(Object[] input, PartialOrder.Relation relation)
If the array cannot be placed in a partial order (has loops) an array with less than input.length elements is returned containing only the elements that did not participate in any cycles. The caller should test the length of the returned array to determine if the sort succeeded.
public static java.lang.Object[] sort(Object[] input, PartialOrder.Precedes[] precedes)
If the array cannot be placed in a partial order (has loops) an array with less than input.length elements is returned containing only the elements that did not participate in any cycles. The caller should test the length of the returned array to determine if the sort succeeded.
All Packages Class Hierarchy This Package Previous Next Index