de.cau.cs.kieler.core.alg
Class DefaultFactory<T>

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.DefaultFactory<T>
Type Parameters:
T - type of instances that are created by this factory
All Implemented Interfaces:
IFactory<T>

public class DefaultFactory<T>
extends Object
implements IFactory<T>

A factory that uses the default constructor to create instances.

Rating red

Constructor Summary
DefaultFactory(Class<? extends T> theclazz)
          Creates an instance factory for the given class.
 
Method Summary
 T create()
          Create an instance of the type that is managed by this factory.
 void destroy(T obj)
          Destroy a given instance by freeing all resources that are contained.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFactory

public DefaultFactory(Class<? extends T> theclazz)
Creates an instance factory for the given class.

Parameters:
theclazz - the class for which instances shall be created
Method Detail

create

public T create()
Create an instance of the type that is managed by this factory.

Specified by:
create in interface IFactory<T>
Returns:
a new instance

destroy

public void destroy(T obj)
Destroy a given instance by freeing all resources that are contained.

Specified by:
destroy in interface IFactory<T>
Parameters:
obj - the instance to destroy