/* This file is part of the algoviz@vt collection of algorithm visualizations. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this distribution. If not, see . */ /** * Binary Node Abstract Data Type. * * @author Andrew Whitaker (aawhitak) * * Developed for Undergraduate Research Spring '08 for the Algorithm * Visualizations project. * * @param */ public interface BinNodeADT { T key(); /** * @return The value held by this node. */ E val(); /** * Sets the value in this node. * * @param val * The new value to give the node. */ void setVal(E val); /** * @return This node's left child, null if it doesn't exist. */ BinNodeADT left(); /** * @return This node's right child, null if it doesn't exist. */ BinNodeADT right(); /** * Sets the left child of this node. * * @param l * The new left child. */ void setLeft(BinNodeADT l); /** * Sets the right child of this node. * * @param r * The new right child. */ void setRight(BinNodeADT r); /** * @return True if this node is a leaf (has no children), false otherwise. */ boolean isLeaf(); }