devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code


/**
 *  TreeNode.java
 */

package com.coolservlets.beans.tree;

import java.util.Vector;

public class TreeNode extends TreeObject implements TreeInterface {

    private String name;
    private String link;
    private boolean visible;
    private Tree children;
    private int id;

    public TreeNode( int id, String name ) {
        super(Tree.NODE);
        this.id = id;
        this.name = name;
        visible = false;
        children = new Tree();
    }
    public TreeNode( int id, String name, String link ) {
        super(Tree.NODE);
        this.id = id;
        this.name = name;
        this.link = link;
        visible = false;
        children = new Tree();
    }
    public void addChild(TreeObject child) {
        children.addChild(child);
    }
    public int getId() {
        return id;
    }
    public String getName() {
        return name;
    }
    public String getLink() {
        return link;
    }
    public Tree getChildren() {
        return children;
    }
    public boolean isVisible() {
        return visible;
    }
    public void setId( int id ) {
        this.id = id;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setLink( String link ) {
        this.link = link;
    }
    public void setVisible(boolean value) {
        visible = value;
    }
    public void toggleVisible() {
        visible = !visible;
    }
}




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com