|
|
|
|
|
|
return sortedList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public interface Comparable<T> { |
|
|
|
|
|
|
|
int compareTo(T other); |
|
|
|
int compare(Comparable<T> a, T b); |
|
|
|
} |
|
|
|
public abstract class FocusOrder : Diagnosticable , Comparable<FocusOrder> { |
|
|
|
public abstract class FocusOrder : Diagnosticable , IComparable { |
|
|
|
public int compareTo(FocusOrder other) { |
|
|
|
public int CompareTo(object other) { |
|
|
|
return doCompare(other); |
|
|
|
} |
|
|
|
|
|
|
|
public int compare(Comparable<FocusOrder> a, FocusOrder b) { |
|
|
|
//throw new NotImplementedException();
|
|
|
|
return a.compareTo(b); |
|
|
|
return doCompare((FocusOrder) other); |
|
|
|
} |
|
|
|
|
|
|
|
protected abstract int doCompare(FocusOrder other); |
|
|
|
|
|
|
"Incompatible order types can't be compared. Use a FocusTraversalGroup to group " + |
|
|
|
"similar orders together." |
|
|
|
); |
|
|
|
return a.order.compareTo(b.order); |
|
|
|
return a.order.CompareTo(b.order); |
|
|
|
}); |
|
|
|
return ordered.Select((_OrderedFocusInfo info) => info.node).Concat(unordered); |
|
|
|
} |
|
|
|