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

📄 testnode.java

📁 自己上学时写的Btree算法
💻 JAVA
字号:
/*
 * TestNode.java
 *
 */

import java.util.Vector;
import java.util.Collections;

/**
 *
 * @author Kun Fang
 */
public class TestNode {
    private Vector<Entry> nodeEntries;  //stored entries in the node
    private Vector<TestNode> children;    //pointers to the children nodes
    
    /** Creates a new instance of TestNode */
    public TestNode(int k) {
        this.nodeEntries = new Vector<Entry>(2*k);
        this.children = new Vector<TestNode>(2*k+1);
    }
    
    public void addEntry(Entry e) {
        nodeEntries.add(e);
    }
    
    public void addChild(TestNode b) {
        children.add(b);
    }
    
    public Vector<Entry> getEntries() {
        return this.nodeEntries;
    }
    
    public String entriesToString() {
        String r = new String();
        for(int i=0;i<nodeEntries.size();i++) {
            r = r + nodeEntries.elementAt(i).getKey();
        }
        return r;
    }
    
    public Vector<TestNode> getChildren() {
        return this.children;
    }
}

⌨️ 快捷键说明

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