X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Fdata%2FNode.java;h=950ed990874b31058b57f3b9a426904fba065808;hb=086aff15fcd35b2dfed9d64b24e5b7dacd8fb684;hp=560fc34ce7e9619e47c0df3872c4ae11040fc07d;hpb=f9979af9d9963cc5ad92ddb63b6193cba2bb1df1;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