net.sourceforge.esw.collection
Class MetaFactory

java.lang.Object
  |
  +--net.sourceforge.esw.collection.MetaFactory

public class MetaFactory
extends java.lang.Object

Responsible for creation of IMetaCollection instances.

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

If a client of the MetaFactory or graph package wishes to provide custom implementations of the IMetaCollection interface, they would also need to create a new IMetaFactory implementor. This IMetaFactory implementor would be set on the MetaFactory and would allow the new custom IMetaCollection instances to be used throughout the architecture.

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

Examples:

   MyCustomMetaFactory customFactory = new MyCustomMetaFactory();
   MetaFactory.setMetaFactory( customFactory );
 

See Also:
IMetaCollection

Field Summary
protected static IMetaFactory metaFactory
          The IMetaFactory instance to which IMetaCollection instance creation is delegated.
 
Constructor Summary
MetaFactory()
           
 
Method Summary
static IMetaCollection createMetaCollection()
          Creates a new empty IMetaCollection instance.
static IMetaCollection createMetaCollection(INode aNode)
          Creates a new IMetaCollection that wraps the given INode instance.
static IMetaCollection createMetaCollection(java.lang.Object aID)
          Creates a new IMetaCollection instance with the specified identifier.
static IMetaCollection createMetaCollection(java.lang.Object aID, java.lang.Object aValue)
          Creates a new IMetaCollection instance with the specified identifier and value.
static IMetaFactory getMetaFactory()
          Returns the IMetaFactory instance being used by this MetaFactory.
static void setMetaFactory(IMetaFactory aMetaFactory)
          Sets the IMetaFactory instance to be used by this MetaFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metaFactory

protected static IMetaFactory metaFactory
The IMetaFactory instance to which IMetaCollection instance creation is delegated.
Constructor Detail

MetaFactory

public MetaFactory()
Method Detail

createMetaCollection

public static IMetaCollection createMetaCollection()
Creates a new empty IMetaCollection instance.

Returns:
an empty IMetaCollection instance.

createMetaCollection

public static IMetaCollection createMetaCollection(java.lang.Object aID)
Creates a new IMetaCollection instance with the specified identifier.

Parameters:
aID - the identifier used by the IMetaCollection instance.
Returns:
an IMetaCollection instance with the specified identifier.

createMetaCollection

public static IMetaCollection createMetaCollection(INode aNode)
Creates a new IMetaCollection that wraps the given INode instance.

Parameters:
aNode - the INode instance to wrap in the returned IMetaCollection instance.
Returns:
a new IMetaCollection that wraps the given INode instance.

createMetaCollection

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

setMetaFactory

public static void setMetaFactory(IMetaFactory aMetaFactory)
Sets the IMetaFactory instance to be used by this MetaFactory.
Parameters:
aMetaFactory - the IMetaFactory instance to be used.

getMetaFactory

public static IMetaFactory getMetaFactory()
Returns the IMetaFactory instance being used by this MetaFactory.


Copyright 2002 Free Software Foundation. All Rights Reserved.