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. package com.sun.corba.se.impl.orbutil.graph ;
  8. /** Data about a node in a graph.
  9. */
  10. public class NodeData
  11. {
  12. private boolean visited ;
  13. private boolean root ;
  14. public NodeData()
  15. {
  16. clear() ;
  17. }
  18. public void clear()
  19. {
  20. this.visited = false ;
  21. this.root = true ;
  22. }
  23. /** Return whether this node has been visited in a traversal.
  24. * Note that we only support a single traversal at a time.
  25. */
  26. boolean isVisited()
  27. {
  28. return visited ;
  29. }
  30. void visited()
  31. {
  32. visited = true ;
  33. }
  34. /** Return whether this node is a root.
  35. */
  36. boolean isRoot()
  37. {
  38. return root ;
  39. }
  40. void notRoot()
  41. {
  42. root = false ;
  43. }
  44. }