jef.dna.infoStructures.impl
Class InfoFactory
java.lang.Object
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)
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 |
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
InfoFactory
public InfoFactory()
- Creates a new instance of InfoFactory
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 instancedis
- The input stream for reading the info structure indna
- The current Dna
instance
- Returns:
- InfoStructure The requested
InfoStructure
instance
- Throws:
DnaDeserializationException
UnknownInfoStructureException
- The provided type is not valid