de.uka.ipd.sdq.ByCounter.instrumentation
Class AdditionalOpcodeInformation

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.instrumentation.AdditionalOpcodeInformation

public final class AdditionalOpcodeInformation
extends java.lang.Object

Additional information about opcodes gathered from their parameters. One class instance of this exists for a counted method, meaning that all occurrences of array constructions are in this one instance.

Since:
0.1
Version:
1.2
Author:
Martin Krogmann, Michael Kuperberg

Field Summary
static int NO_INFORMATION_INT
          This integer signals that the entry with this value holds no information.
static java.lang.String NO_INFORMATION_STRING
          This string signals that the entry with this value holds no information.
static int[] OPCODES_STORING_ADDITIONAL_INFORMATION
          This is a list of opcodes for which a place in the additional information arrays is reserved.
 
Constructor Summary
AdditionalOpcodeInformation()
          Construct empty AdditionalOpcodeInformation.
AdditionalOpcodeInformation(java.lang.String[] foundMethodInvStrings, int[] intInformation, java.lang.String[] stringInformation)
          Construct AdditionalOpcodeInformation with the given parameters.
 
Method Summary
 void addAdditionalInformation(int i, java.lang.String s)
          Add additional information entry.
 int getIndexOfAdditionInformation(int integer, java.lang.String s)
          Check whether the specified information tuple (integer, s) exists and return its index if it does.
 int[] getIntInformation()
          This is always connected to the string information with the same index.
 java.util.List<java.lang.String> getMethodInvokations()
          Get the list containing all method signatures that were called in the visited method.
 java.util.List<java.lang.String> getStringInformation()
          This is always connected to the int information with the same index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_INFORMATION_INT

public static final int NO_INFORMATION_INT
This integer signals that the entry with this value holds no information.

See Also:
Constant Field Values

NO_INFORMATION_STRING

public static final java.lang.String NO_INFORMATION_STRING
This string signals that the entry with this value holds no information.

See Also:
Constant Field Values

OPCODES_STORING_ADDITIONAL_INFORMATION

public static final int[] OPCODES_STORING_ADDITIONAL_INFORMATION
This is a list of opcodes for which a place in the additional information arrays is reserved.

Constructor Detail

AdditionalOpcodeInformation

public AdditionalOpcodeInformation()
Construct empty AdditionalOpcodeInformation.


AdditionalOpcodeInformation

public AdditionalOpcodeInformation(java.lang.String[] foundMethodInvStrings,
                                   int[] intInformation,
                                   java.lang.String[] stringInformation)
Construct AdditionalOpcodeInformation with the given parameters. Make sure that intInformation and stringInformation have the same size.

Parameters:
foundMethodInvStrings - Method descriptors.
intInformation - Information as integer. Examples: array dimension, array element type, etc.
stringInformation - Information as integer. Could be type descriptors for array construction.
Method Detail

addAdditionalInformation

public void addAdditionalInformation(int i,
                                     java.lang.String s)
Add additional information entry. Int and String information is always coupled. If no information is to be stored, use NO_INFORMATION_*.

Parameters:
i - Integer information.
s - String information.

getIndexOfAdditionInformation

public int getIndexOfAdditionInformation(int integer,
                                         java.lang.String s)
Check whether the specified information tuple (integer, s) exists and return its index if it does.

Parameters:
integer - Integer information.
s - String information.
Returns:
The index when found. -1 if not found.

getIntInformation

public int[] getIntInformation()
This is always connected to the string information with the same index.

Returns:
return A list of ints possibly containing opcode parameter information.

getMethodInvokations

public java.util.List<java.lang.String> getMethodInvokations()
Get the list containing all method signatures that were called in the visited method.

Returns:
A map containing method signatures as keys in the form owner + "." + name + desc. Signatures are specific to the object they are invoked on. This means that a certain methods may be more than once in the array. However, their signatures differ, as the owner property differs.

getStringInformation

public java.util.List<java.lang.String> getStringInformation()
This is always connected to the int information with the same index.

Returns:
A list of strings possibly containing opcode parameter information.