KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > orbutil > graph > NodeData


1 /*
2  * @(#)NodeData.java 1.3 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.orbutil.graph ;
9
10 /** Data about a node in a graph.
11  */

12 public class NodeData
13 {
14     private boolean visited ;
15     private boolean root ;
16
17     public NodeData()
18     {
19     clear() ;
20     }
21
22     public void clear()
23     {
24     this.visited = false ;
25     this.root = true ;
26     }
27
28     /** Return whether this node has been visited in a traversal.
29      * Note that we only support a single traversal at a time.
30      */

31     boolean isVisited()
32     {
33     return visited ;
34     }
35
36     void visited()
37     {
38     visited = true ;
39     }
40
41     /** Return whether this node is a root.
42      */

43     boolean isRoot()
44     {
45     return root ;
46     }
47
48     void notRoot()
49     {
50     root = false ;
51     }
52 }
53
Popular Tags