nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.instanceFactories
Class InstanceFactoryRegistry

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.algorithm.reusablecores.instanceFactories.InstanceFactoryRegistry

public class InstanceFactoryRegistry
extends java.lang.Object

Static class that holds a reference to all known factories for transforming objects to Instance objects indexed by object class. If the class is not in the registry, the DefaultInstanceFactory is returned instead.


Method Summary
 InstanceFactory getFactory(java.lang.Class type)
          Returns the InstanceFactory that transforms object of the type determined by the given class object or the DefaultInstanceFactory if no factory of the correct type is given.
static InstanceFactoryRegistry newInstance()
          Creates the factory if necessary and then returns a reference to this registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static InstanceFactoryRegistry newInstance()
Creates the factory if necessary and then returns a reference to this registry

Returns:
reference to InstanceFactoryRegistry object.

getFactory

public InstanceFactory getFactory(java.lang.Class type)
Returns the InstanceFactory that transforms object of the type determined by the given class object or the DefaultInstanceFactory if no factory of the correct type is given.

Parameters:
type - class of object to transform
Returns:
appropriate factory to create an instance from this object type