org.hypergraphdb.type
Class GenericObjectFactory<T>

java.lang.Object
  extended by org.hypergraphdb.type.GenericObjectFactory<T>
All Implemented Interfaces:
ObjectFactory<T>

public class GenericObjectFactory<T>
extends java.lang.Object
implements ObjectFactory<T>

An ObjectFactory implementation that simply uses a specific Class to fabricate instances. If the Class has a constructor taking a single argument of type HGHandle[] than this constructor is used in a call to the make(HGHandle [] targetSet) method. Otherwise, if that latter version of make is called, an exception will be thrown. Note that the implementation doesn't check whether the Class that it handles actually implements the HGLink interface.

Author:
Borislav Iordanov

Constructor Summary
GenericObjectFactory(java.lang.Class<T> type)
           
 
Method Summary
 java.lang.Class<T> getType()
           Return the Class of the objects being constructed by this factory.
 T make()
          Create a new run-time instance of the type this factory is responsible for.
 T make(HGHandle[] targetSet)
          Create a new run-time HGLink instance of the type this factory is responsible for.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericObjectFactory

public GenericObjectFactory(java.lang.Class<T> type)
Method Detail

getType

public java.lang.Class<T> getType()
Description copied from interface: ObjectFactory

Return the Class of the objects being constructed by this factory.

Specified by:
getType in interface ObjectFactory<T>

make

public T make()
Description copied from interface: ObjectFactory

Create a new run-time instance of the type this factory is responsible for.

Specified by:
make in interface ObjectFactory<T>

make

public T make(HGHandle[] targetSet)
Description copied from interface: ObjectFactory

Create a new run-time HGLink instance of the type this factory is responsible for.

Specified by:
make in interface ObjectFactory<T>