net.sourceforge.esw.graph
Class NodeFactory

java.lang.Object
  |
  +--net.sourceforge.esw.graph.NodeFactory

public class NodeFactory
extends java.lang.Object

Responsible for creation of INode instances.

"Pluggable factories" allow the application to add its own custom implementations of the INode interface to the framework in a consitent, simple way. Custom implementations of the INode interface can thus be used as if they were a standard part of the framework.

The default implementation returns the ESW implementation of the INode interface.

Examples:

   MyCustomNodeFactory customFactory = new MyCustomNodeFactory();
   NodeFactory.setNodeFactory( customFactory );
 

See Also:
INode

Field Summary
protected static INodeFactory nodeFactory
          The INodeFactory instance to which INode instance creation is delegated.
 
Constructor Summary
NodeFactory()
           
 
Method Summary
static INode createNode()
          Creates a new empty INode instance.
static INode createNode(java.lang.Object aID)
          Creates a new INode instance with the specified identifier.
static INode createNode(java.lang.Object aID, java.lang.Object aValue)
          Creates a new INode instance with the specified identifier and value.
static INodeFactory getNodeFactory()
          Returns the INodeFactory instance being used by this NodeFactory.
static void setNodeFactory(INodeFactory aNodeFactory)
          Sets the INodeFactory instance to be used by this NodeFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeFactory

protected static INodeFactory nodeFactory
The INodeFactory instance to which INode instance creation is delegated.
Constructor Detail

NodeFactory

public NodeFactory()
Method Detail

createNode

public static INode createNode()
Creates a new empty INode instance.
Returns:
an empty INode instance.

createNode

public static INode createNode(java.lang.Object aID)
Creates a new INode instance with the specified identifier.
Parameters:
aID - the identifier used by the INode instance.
Returns:
an INode instance with the specified identifier.

createNode

public static INode createNode(java.lang.Object aID,
                               java.lang.Object aValue)
Creates a new INode instance with the specified identifier and value.
Parameters:
aID - the identifier used by the INode instance.
aValue - the value used by the INode instance.
Returns:
an INode instance with the specified identifier and value.

setNodeFactory

public static void setNodeFactory(INodeFactory aNodeFactory)
Sets the INodeFactory instance to be used by this NodeFactory.
Parameters:
aNodeFactory - the INodeFactory instance to be used.

getNodeFactory

public static INodeFactory getNodeFactory()
Returns the INodeFactory instance being used by this NodeFactory.


Copyright 2002 Free Software Foundation. All Rights Reserved.