package net.pterodactylus.util.data;
+import java.util.Comparator;
import java.util.Iterator;
/**
* @param <E>
* The type of the element to store
*/
-public interface Node<E> extends Iterable<Node<E>> {
+public interface Node<E extends Comparable<E>> extends Iterable<Node<E>>, Comparable<Node<E>> {
/**
* Returns the parent node of the node.
*/
public Node<E> 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<Node<E>> comparator);
+
}
\ No newline at end of file