jef.dna.infoStructures
Interface InfoStructuresFactory

All Known Implementing Classes:
InfoFactory

public interface InfoStructuresFactory

This interface defines the methods every real factory implementation has to provide.

Author:
Francesco Russo frusso@cs.unibo.it

Field Summary
static int ATTRIBUTE_INFO
          Constant to be used for instantiating an Attribute Info
static int FIELD_INFO
          Constant to be used for instantiating a Field Info
static int METHOD_INFO
          Constant to be used for instantiating an Method Info
 
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.
 

Field Detail

ATTRIBUTE_INFO

static final int ATTRIBUTE_INFO
Constant to be used for instantiating an Attribute Info

See Also:
Constant Field Values

FIELD_INFO

static final int FIELD_INFO
Constant to be used for instantiating a Field Info

See Also:
Constant Field Values

METHOD_INFO

static final int METHOD_INFO
Constant to be used for instantiating an Method Info

See Also:
Constant Field Values
Method Detail

getInstance

InfoStructure getInstance(int type)
                          throws UnknownInfoStructureException
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.

Parameters:
type - The type of the required instance
Returns:
InfoStructure A valid InfoStructure implementation of the given type type
Throws:
DnaDeserializationException
UnknownInfoStructureException

getInstance

InfoStructure getInstance(int type,
                          java.io.DataInputStream dis,
                          Dna dna)
                          throws UnknownInfoStructureException,
                                 DnaDeserializationException
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.

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:
UnknownInfoStructureException - The provided type is not valid
DnaDeserializationException