⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rangenode.java

📁 生物物种进化历程的演示
💻 JAVA
字号:
// only used by rangetree, which is never used itself/*   Copyright (c) 2002 Compaq Computer Corporation      SOFTWARE RELEASE      Permission is hereby granted, free of charge, to any person obtaining   a copy of this software and associated documentation files (the   "Software"), to deal in the Software without restriction, including   without limitation the rights to use, copy, modify, merge, publish,   distribute, sublicense, and/or sell copies of the Software, and to   permit persons to whom the Software is furnished to do so, subject to   the following conditions:      - Redistributions of source code must retain the above copyright     notice, this list of conditions and the following disclaimer.      - Redistributions in binary form must reproduce the above copyright     notice, this list of conditions and the following disclaimer in the     documentation and/or other materials provided with the distribution.      - Neither the names of Compaq Research, Compaq Computer Corporation     nor the names of its contributors may be used to endorse or promote     products derived from this Software without specific prior written     permission.      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.    IN NO EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY CLAIM,   DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR   THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/package TreeJuxtaposer;/** * A class representing a node in a RangeTree. * * A RangeNode is a helper class for computing relationships between * phylogenetic trees and is distinct from a TreeNode which is a node * of a Tree. *  * @author  Yunhong Zhou * */public class RangeNode {    /** this will hold the data (Tree object or Point) */    private Object Data=null;      /** left child of the current node */    private RangeNode lc=null;    /** right child of the current node */    private RangeNode rc=null;     /**      * Field element holds the X or Y coordinate of the object in the tree.     * This will help in findSplitRangeNode and Query1D/2D.     */    private int element=0;       /** total number of leaves decedant to this node */    private int leafCount = 1;    /** empty constructor */    public RangeNode() 	{;} 	    /** constructor with Data initiated */    public RangeNode(Object d) { Data = d; }	    /**     * set appropriate coordinate depending on the tree type.     */    public void setElement(int e) { element=e; }	    public int getElement() { return element; }	    /** @return true if the node is a leaf, false otherwise */    public boolean childless() {	return (lc==null) && (rc==null);    }	    void setData(Object d) { Data=d; }	    Object getData() { return Data; }        RangeNode getLc() { return lc; }	    RangeNode getRc() { return rc; }	    void setLeft(RangeNode O) { lc=O; }        void setRight(RangeNode O) { rc=O; }    /** set the total of leaves decedant to it */    void setLeafCount(int cnt) {leafCount = cnt; }    /** get the total number of leaves decedant to it*/    int getLeafCount() { return leafCount; }};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -