Package com.dassault_systemes.catweb.base.util

   
Class Node

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catweb.base.util.Leaf
        |
        +-com.dassault_systemes.catweb.base.util.Node
Class Location

Framework : PortalBase

Module : PLBbase

Class Description

public class Node

Node of a tree extends Leaf because a node can also be considered as a leaf

   All Implemented Interfaces:
Transferable
Field Summary

Constructor Summary
Node(Node father, String value, Leaf[] list)
Node(Node father, String value, String iconName, int mode, Leaf[] list)
Node(Node father, String val)
Node(Leaf[] list)

Method Summary
void setLeafList(Leaf[] list)
void addChild(Leaf leaf)
void removeChild(Leaf leaf)
void setLeafVector(Vector vector)
Leaf[] getLeafList()
Leaf[] getVisibleLeafList()
int getNbElement(Node node)
boolean isOpen()
void setOpen(boolean flag)
boolean equals(Node node)


Field Detail

Constructor Detail

Node

    Node(Node father, String value, Leaf[] list)

Constructs a new Node with the specified father Node, label name and children Leaf

Parameters:
father
- the father Node of this Node
value
- the label name of this Node
list
- the children Leaf of this Node

Node

    Node(Node father, String value, String iconName, int mode, Leaf[] list)

Constructs a new Node with the specified father Node, label name and children Leaf

Parameters:
father
- the father Node of this Node
value
- the label name of this Node
iconName
- the name of the icon associated to this Node
mode
- the display mode of this Node :
list
- the children Leaf of this Node

Node

    Node(Node father, String val)

Constructs a new Node with the specified father Node, label name and no children Leaf

Parameters:
father
- the father Node of this Node
value
- the label name of this Node

Node

    Node(Leaf[] list)

Constructs a new Node with no father Node, no label name but with children Leaf

Parameters:
list
- the children Leaf of this Node

Method Detail

setLeafList

    void setLeafList(Leaf[] list)

Sets the cildren Leaf of this Node.

Parameters:
list
- the array of leaf to set as children

addChild

    void addChild(Leaf leaf)

Adds a new Leaf to the children Leaf of this Node.

Parameters:
leaf
- the leaf to add

removeChild

    void removeChild(Leaf leaf)

Removes a child Leaf.

Parameters:
leaf
- the leaf to remove.

setLeafVector

    void setLeafVector(Vector vector)

Sets the cildren Leaf of this Node

Parameters:
vector
- the vector of leaf to set as children

getLeafList

    Leaf[] getLeafList()

Returns the list of leaves under this node


getVisibleLeafList

    Leaf[] getVisibleLeafList()

Returns the list of leaves that are visible under this node


getNbElement

    int getNbElement(Node node)

Returns the number of elements under a given node. (recursive method)

Parameters:
node
- the start node.

isOpen

    boolean isOpen()

Determines whether this Node is open


setOpen

    void setOpen(boolean flag)

Closes or opens this Node depending on the value of parameter flag.


equals

    boolean equals(Node node)

Compares recursively the equality of two nodes

Parameters:
node
- the node to compare with this instance


Copyright © 2000, Dassault Systèmes. All rights reserved