alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

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;
    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.