treenode.java

来自「这个是perst-269.zip下面的SOURCECODE,和大家分享了。」· Java 代码 · 共 29 行

JAVA
29
字号
import org.garret.perst.*;

public class TreeNode extends Persistent { 
    public String   question;
    public TreeNode yes;    
    public TreeNode no;
    
    public void writeObject(IOutputStream out) { 
        out.writeString(question);
        out.writeObject(yes);        
        out.writeObject(no);
    }

    
    public void readObject(IInputStream in) { 
        question = in.readString();
        yes = (TreeNode)in.readObject();        
        no = (TreeNode)in.readObject();        
    }

    public TreeNode(TreeNode no, String question, TreeNode yes) { 
        this.yes = yes;
        this.question = question;
        this.no = no;
    }

    public TreeNode() {}
}

⌨️ 快捷键说明

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