jef.dna.infoStructures.impl
Class InfoFactory

java.lang.Object
  extended by jef.dna.infoStructures.impl.InfoFactory
All Implemented Interfaces:
InfoStructuresFactory

public class InfoFactory
extends java.lang.Object
implements InfoStructuresFactory

This class is the factory needed for instantiating InfoStructures.

Author:
Francesco Russo (frusso@cs.unibo.it)

Field Summary
 int ATTRIBUTE_INFO
           
 int FIELD_INFO
           
 int METHOD_INFO
           
 
Constructor Summary
InfoFactory()
          Creates a new instance of InfoFactory
 
Method Summary
 InfoStructure getInstance(int type)
          Returns a new InfoStructure instance according to the type specified as input parameter.
 InfoStructure getInstance(int type, java.io.DataInputStream dis, Dna dna)
          Returns a new InfoStructure instance according to the type specified as input parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_INFO

public final int ATTRIBUTE_INFO
See Also:
Constant Field Values

FIELD_INFO

public final int FIELD_INFO
See Also:
Constant Field Values

METHOD_INFO

public final int METHOD_INFO
See Also:
Constant Field Values
Constructor Detail

InfoFactory

public InfoFactory()
Creates a new instance of InfoFactory

Method Detail

getInstance

public InfoStructure getInstance(int type)
                          throws UnknownInfoStructureException
Description copied from interface: InfoStructuresFactory
Returns a new InfoStructure instance according to the type specified as input parameter. This type has to be one of the valid types defined by this interface's public constants. After this method has been invoked, please remember to initialize the obtained instance by calling its fromStream method, and by setting the reference to the Dna instance this INFO_structure will belong to.

Specified by:
getInstance in interface InfoStructuresFactory
Parameters:
type - The type of the required instance
Returns:
InfoStructure A valid InfoStructure implementation of the given type type
Throws:
UnknownInfoStructureException

getInstance

public InfoStructure getInstance(int type,
                                 java.io.DataInputStream dis,
                                 Dna dna)
                          throws DnaDeserializationException,
                                 UnknownInfoStructureException
Description copied from interface: InfoStructuresFactory
Returns a new InfoStructure instance according to the type specified as input parameter. This type has to be one of the valid types defined by this interface's public constants.

Specified by:
getInstance in interface InfoStructuresFactory
Parameters:
type - The type of the required instance
dis - The input stream for reading the info structure in
dna - The current Dna instance
Returns:
InfoStructure The requested InfoStructure instance
Throws:
DnaDeserializationException
UnknownInfoStructureException - The provided type is not valid