net.sourceforge.esw.graph
Class DefaultNodeFactory

java.lang.Object
  |
  +--net.sourceforge.esw.graph.DefaultNodeFactory
All Implemented Interfaces:
INodeFactory

public class DefaultNodeFactory
extends java.lang.Object
implements INodeFactory

Defines the methods for creation of INode instances.

This is the default implementation of the INodeFactory interface which simply creates and returns the default ESW implementation of the INode interface.

This is the Abstract Factory of the Abstract Factory design pattern.

"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.

Examples:

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


Constructor Summary
DefaultNodeFactory()
           
 
Method Summary
 INode createNode()
          Creates a new empty INode instance.
 INode createNode(java.lang.Object aID)
          Creates a new INode instance with the specified identifier.
 INode createNode(java.lang.Object aID, java.lang.Object aValue)
          Creates a new INode instance with the specified identifier and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNodeFactory

public DefaultNodeFactory()
Method Detail

createNode

public INode createNode()
Creates a new empty INode instance.
Specified by:
createNode in interface INodeFactory
Returns:
an empty INode instance.

createNode

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

createNode

public INode createNode(java.lang.Object aID,
                        java.lang.Object aValue)
Creates a new INode instance with the specified identifier and value.
Specified by:
createNode in interface INodeFactory
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.


Copyright 2002 Free Software Foundation. All Rights Reserved.