public void sort() {
if (children == null)
return;
- Collections.sort(this.children, new Comparator<UpdateNode>() {
+ Comparator<UpdateNode> comparator = new Comparator<UpdateNode>() {
@Override
public int compare(UpdateNode o1, UpdateNode o2) {
return o1.getLabel().compareTo(o2.getLabel());
}
- });
+ };
+ Collections.sort(this.children, comparator );
+ for (UpdateNode n : this.children) {
+ n.sort(comparator);
+ }
+ }
+
+ public void sort(Comparator<UpdateNode> comparator ) {
+ if (children == null)
+ return;
+ Collections.sort(this.children, comparator );
+ for (UpdateNode n : this.children) {
+ n.sort(comparator);
+ }
}
public ImageDescriptor getImage(ReadGraph graph) throws DatabaseException {