net.sourceforge.esw.graph
Class NodeUtil
java.lang.Object
|
+--net.sourceforge.esw.graph.NodeUtil
- public class NodeUtil
- extends java.lang.Object
Provides utility methods for the graph package.
These methods are generally useful, but are utilities in nature and do not
belong in the core APIs.
Method Summary |
static boolean |
childrenEqual(INode firstNode,
INode secondNode)
Compares the two specified INode instances and return
true if all their children are equal. |
static INode |
deepClone(INode aNode)
Creates a deep clone of the specified INode instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeUtil
public NodeUtil()
deepClone
public static INode deepClone(INode aNode)
- Creates a deep clone of the specified
INode
instance. This
will return an exact copy of the specified INode
instance
including an exact copy of the INode
instances' children, and
their children, and so on. This deepClone
method does not
consider the parents of the specified INode
instance for the
cloning operation.
- Parameters:
aNode
- the INode
instance to perform the deep clone
operation against.- Returns:
- an exact but separate copy of the graph specified by the
INode
instance.
childrenEqual
public static boolean childrenEqual(INode firstNode,
INode secondNode)
- Compares the two specified
INode
instances and return
true
if all their children are equal. Equality is defined by
a call to the equals
method of the INode
instances.
- Parameters:
firstNode
- the first INode
instance to compare for
equality.secondNode
- the second INode
instance to compare for
equality.- Returns:
true
if they are equal, false
otherwise.
Copyright 2002 Free Software Foundation. All Rights Reserved.