de.uka.ipd.sdq.ByCounter.parsing
Class BasicBlockSerialisation

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.parsing.BasicBlockSerialisation

public final class BasicBlockSerialisation
extends java.lang.Object

This class is used to serialise and deserialise basic block definitions of an instrumentation run.


Field Summary
static java.lang.String FILE_BASIC_BLOCK_SERIALISATION
           
static java.lang.String FILE_RANGE_BLOCK_SERIALISATION
           
 
Constructor Summary
BasicBlockSerialisation()
           
 
Method Summary
 void addBasicBlocksForMethod(java.lang.String method, InstructionBlockDescriptor[] basicBlocks)
          Adds basic block definitions for a given method.
static BasicBlockSerialisation deserialise(java.io.File file)
          Read a serialisation file written using the serialise(BasicBlockSerialisation, File) method.
 java.util.HashMap<java.lang.String,InstructionBlockDescriptor[]> getBasicBlocksByMethod()
           
static void serialise(BasicBlockSerialisation bbs, java.io.File file)
          Serialise basic block definitions.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_BASIC_BLOCK_SERIALISATION

public static final java.lang.String FILE_BASIC_BLOCK_SERIALISATION
See Also:
Constant Field Values

FILE_RANGE_BLOCK_SERIALISATION

public static final java.lang.String FILE_RANGE_BLOCK_SERIALISATION
See Also:
Constant Field Values
Constructor Detail

BasicBlockSerialisation

public BasicBlockSerialisation()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

serialise

public static void serialise(BasicBlockSerialisation bbs,
                             java.io.File file)
                      throws java.io.IOException
Serialise basic block definitions. You need to create an instance of BasicBlockSerialisation and use the addBasicBlocksForMethod(String, InstructionBlockDescriptor[]) method to add basic block definitions.

Parameters:
bbs - An instance of BasicBlockSerialisation.
file - The file to write to.
Throws:
java.io.IOException - Thrown when writing to disk fails.

deserialise

public static BasicBlockSerialisation deserialise(java.io.File file)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException,
                                                  java.lang.ClassNotFoundException
Read a serialisation file written using the serialise(BasicBlockSerialisation, File) method.

Parameters:
file - The file to read the serialisation from.
Returns:
An instance of BasicBlockSerialisation.
Throws:
java.io.FileNotFoundException - Thrown when the specified file cannot be found.
java.io.IOException - Thrown when reading fails.
java.lang.ClassNotFoundException - Thrown when the format of the serialised file is wrong.

addBasicBlocksForMethod

public void addBasicBlocksForMethod(java.lang.String method,
                                    InstructionBlockDescriptor[] basicBlocks)
Adds basic block definitions for a given method.

Parameters:
method - Method description for the method to which the basic block belongs.
basicBlocks - Basic blocks to add. method.

getBasicBlocksByMethod

public java.util.HashMap<java.lang.String,InstructionBlockDescriptor[]> getBasicBlocksByMethod()
Returns:
the basicBlocksByMethod