sofya.ed.semantic
Class AbstractEventSpecification

java.lang.Object
  extended by sofya.ed.semantic.AbstractEventSpecification
All Implemented Interfaces:
EventSpecification
Direct Known Subclasses:
AllEvents, AllModuleEvents, ModuleDescription

public abstract class AbstractEventSpecification
extends java.lang.Object
implements EventSpecification

Abstract class which provides various utility methods to classes implementing an event specification.

Version:
06/14/2005
Author:
Alex Kinneer

Nested Class Summary
 
Nested classes/interfaces inherited from interface sofya.ed.semantic.EventSpecification
EventSpecification.CallType, EventSpecification.FieldType, EventSpecification.MethodAction, EventSpecification.MonitorType
 
Field Summary
 
Fields inherited from interface sofya.ed.semantic.EventSpecification
FIELD_WITNESS_NONE, FIELD_WITNESS_READ, FIELD_WITNESS_WRITE
 
Constructor Summary
AbstractEventSpecification()
           
 
Method Summary
protected static gnu.trove.TObjectIntHashMap deserializeObjectIntMap(java.io.DataInputStream in)
          Deserializes an object-to-integer map from an input stream.
protected static ProgramUnit deserializeProgramUnit(java.io.DataInputStream in)
          Deserializes a ProgramUnit from an output stream.
protected static java.util.Collection deserializeStrings(java.io.DataInputStream in, java.util.Collection strings)
          Deserializes a collection of strings from an input stream.
protected static void serializeObjectIntMap(java.io.DataOutputStream out, gnu.trove.TObjectIntHashMap map)
          Serializes an object-to-integer map to an output stream.
protected static void serializeProgramUnit(java.io.DataOutputStream out, ProgramUnit pUnit)
          Serializes a ProgramUnit to an output stream.
protected static void serializeStrings(java.io.DataOutputStream out, java.util.Collection strings)
          Serializes a collection of strings to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sofya.ed.semantic.EventSpecification
deserialize, getModuleClasses, getSystemClasses, serialize, useCallInterceptor, witnessAnyMonitor, witnessCall, witnessCatch, witnessCatch, witnessConstructorEntry, witnessConstructorExit, witnessField, witnessField, witnessField, witnessMethodEntry, witnessMethodExit, witnessMonitor, witnessNewObject, witnessStaticInitializerEntry, witnessThrow, witnessThrow
 

Constructor Detail

AbstractEventSpecification

public AbstractEventSpecification()
Method Detail

serializeStrings

protected static void serializeStrings(java.io.DataOutputStream out,
                                       java.util.Collection strings)
                                throws java.io.IOException
Serializes a collection of strings to an output stream.

Parameters:
out - Stream to which strings will be serialized.
strings - Collection of strings to be serialized.
Throws:
java.io.IOException - On any I/O error which prevents writing to the stream.

deserializeStrings

protected static java.util.Collection deserializeStrings(java.io.DataInputStream in,
                                                         java.util.Collection strings)
                                                  throws java.io.IOException
Deserializes a collection of strings from an input stream.

The stream must be pointing to a leading integer indicating the number of strings to be read.

Parameters:
in - Stream from which to deserialize the strings.
strings - [out] Collection which will receive the deserialized strings.
Returns:
A reference to the collection of strings.
Throws:
java.io.IOException - On any I/O error which prevents reading from the stream.

serializeObjectIntMap

protected static void serializeObjectIntMap(java.io.DataOutputStream out,
                                            gnu.trove.TObjectIntHashMap map)
                                     throws java.io.IOException
Serializes an object-to-integer map to an output stream.

Parameters:
out - Stream to which the map will be serialized.
map - Object/int map to be serialized.
Throws:
java.io.IOException - On any I/O error which prevents writing to the stream.

deserializeObjectIntMap

protected static gnu.trove.TObjectIntHashMap deserializeObjectIntMap(java.io.DataInputStream in)
                                                              throws java.io.IOException
Deserializes an object-to-integer map from an input stream.

Parameters:
in - Stream from which the map will be deserialized.
Returns:
The deserialized map.
Throws:
java.io.IOException - On any I/O error which prevents reading from the stream.

serializeProgramUnit

protected static void serializeProgramUnit(java.io.DataOutputStream out,
                                           ProgramUnit pUnit)
                                    throws java.io.IOException
Serializes a ProgramUnit to an output stream.

Parameters:
out - Stream to which the ProgramUnit will be serialized.
pUnit - ProgramUnit to be serialized.
Throws:
java.io.IOException - On any I/O error which prevents writing to the stream.

deserializeProgramUnit

protected static ProgramUnit deserializeProgramUnit(java.io.DataInputStream in)
                                             throws java.io.IOException
Deserializes a ProgramUnit from an output stream.

Parameters:
in - Stream from which the ProgramUnit will be deserialized.
Returns:
The deserialized ProgramUnit.
Throws:
java.io.IOException - On any I/O error which prevents reading from the stream.