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)
Constructs a new Node with the specified father Node, label name and children Leaf
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
Node(Node father, String val)
Constructs a new Node with the specified father Node, label name and no children Leaf
Node(Leaf[] list)
Constructs a new Node with no father Node, no label name but with children Leaf

Method Summary
public void addChild(Leaf leaf)
Adds a new Leaf to the children Leaf of this Node.
public boolean equals(Node node)
Compares recursively the equality of two nodes
public Leaf[] getLeafList()
Returns the list of leaves under this node
public int getNbElement(Node node)
Returns the number of elements under a given node.
public Leaf[] getVisibleLeafList()
Returns the list of leaves that are visible under this node
public boolean isOpen()
Determines whether this Node is open
public void removeChild(Leaf leaf)
Removes a child Leaf.
public void setLeafList(Leaf[] list)
Sets the cildren Leaf of this Node.
public void setLeafVector(Vector vector)
Sets the cildren Leaf of this Node
public void setOpen(boolean flag)
Closes or opens this Node depending on the value of parameter flag.


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
See Also:
com.dassault_systemes.catweb.base.util.Leaf

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
See Also:
com.dassault_systemes.catweb.base.util.Leaf#ICON_DISPLAYED_FIRST
com.dassault_systemes.catweb.base.util.Leaf#NAME_DISPLAYED_FIRST
com.dassault_systemes.catweb.base.util.Leaf

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
See Also:
com.dassault_systemes.catweb.base.util.Leaf

Method Detail

addChild

    public void addChild(Leaf leaf)

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

Parameters:
leaf
- the leaf to add

equals

    public boolean equals(Node node)

Compares recursively the equality of two nodes

Parameters:
node
- the node to compare with this instance

getLeafList

    public Leaf[] getLeafList()

Returns the list of leaves under this node


getNbElement

    public int getNbElement(Node node)

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

Parameters:
node
- the start node.

getVisibleLeafList

    public Leaf[] getVisibleLeafList()

Returns the list of leaves that are visible under this node


isOpen

    public boolean isOpen()

Determines whether this Node is open


removeChild

    public void removeChild(Leaf leaf)

Removes a child Leaf.

Parameters:
leaf
- the leaf to remove.

setLeafList

    public void setLeafList(Leaf[] list)

Sets the cildren Leaf of this Node.

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

setLeafVector

    public void setLeafVector(Vector vector)

Sets the cildren Leaf of this Node

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

setOpen

    public void setOpen(boolean flag)

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



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