X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Fdata%2FNode.java;h=950ed990874b31058b57f3b9a426904fba065808;hb=f52356f8351e099a243ee7b470a37f449bc88b1b;hp=560fc34ce7e9619e47c0df3872c4ae11040fc07d;hpb=95caf3bdb2b7946e4f20a45025f730dd47c5985c;p=jSite2.git diff --git a/src/net/pterodactylus/util/data/Node.java b/src/net/pterodactylus/util/data/Node.java index 560fc34..950ed99 100644 --- a/src/net/pterodactylus/util/data/Node.java +++ b/src/net/pterodactylus/util/data/Node.java @@ -1,6 +1,7 @@ package net.pterodactylus.util.data; +import java.util.Comparator; import java.util.Iterator; /** @@ -12,7 +13,7 @@ import java.util.Iterator; * @param * The type of the element to store */ -public interface Node extends Iterable> { +public interface Node> extends Iterable>, Comparable> { /** * Returns the parent node of the node. @@ -152,4 +153,17 @@ public interface Node extends Iterable> { */ public Node findChild(E element); + /** + * Sorts all children according to their natural order. + */ + public void sortChildren(); + + /** + * Sorts all children with the given comparator. + * + * @param comparator + * The comparator used to sort the children + */ + public void sortChildren(Comparator> comparator); + } \ No newline at end of file