Class SerializedState.Frame

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    SerializedState

    public static final class SerializedState.Frame
    extends java.lang.Object
    implements java.io.Serializable
    MethodState's and LockState's state translated for serialization.
    See Also:
    Serialized Form
    • Field Detail

      • className

        private final java.lang.String className
      • methodId

        private final int methodId
      • continuationPointId

        private final int continuationPointId
      • monitors

        private final java.lang.Object[] monitors
    • Constructor Detail

      • Frame

        public Frame​(java.lang.String className,
                     int methodId,
                     int continuationPointId,
                     java.lang.Object[] monitors,
                     SerializedState.Data variables,
                     SerializedState.Data operands)
        Constructs a SerializedState.Frame object.
        Parameters:
        className - class name
        methodId - method id
        continuationPointId - continuation point id
        monitors - monitor locks
        variables - lock variable table values
        operands - operand stack values
        Throws:
        java.lang.NullPointerException - if any argument is null
        java.lang.IllegalArgumentException - if any elements in monitors are null or if either variables or operands are in an invalid state
    • Method Detail

      • getClassName

        public java.lang.String getClassName()
        Get class name.
        Returns:
        class name
      • getMethodId

        public int getMethodId()
        Get method ID.
        Returns:
        method ID
      • getContinuationPointId

        public int getContinuationPointId()
        Get continuation point id.
        Returns:
        continuation point id
      • getMonitors

        public java.lang.Object[] getMonitors()
        Get monitor locks.
        Returns:
        monitor locks
      • withVariables

        public SerializedState.Frame withVariables​(int[] ints,
                                                   float[] floats,
                                                   long[] longs,
                                                   double[] doubles,
                                                   java.lang.Object[] objects,
                                                   int[] continuationIndexes)
        Helper to copy this frame but with potentially new variables.
        Parameters:
        ints - new ints (or null if should be kept the same)
        floats - new floats (or null if should be kept the same)
        longs - new longs (or null if should be kept the same)
        doubles - new doubles (or null if should be kept the same)
        objects - new objects (or null if should be kept the same)
        continuationIndexes - new continuation indexes (or null if should be kept the same)
        Returns:
        new frame
        Throws:
        java.lang.IllegalArgumentException - if continuationIndexes points to out of bounds indexes within objects or if if continuationIndexes points to non-null indexes within objects
      • withIntVariables

        public SerializedState.Frame withIntVariables​(int[] ints)
        Helper to copy this frame but with new int variables.
        Parameters:
        ints - new ints
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withFloatVariables

        public SerializedState.Frame withFloatVariables​(float[] floats)
        Helper to copy this frame but with new float variables.
        Parameters:
        floats - new floats
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withLongVariables

        public SerializedState.Frame withLongVariables​(long[] longs)
        Helper to copy this frame but with new long variables.
        Parameters:
        longs - new longs
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withDoubleVariables

        public SerializedState.Frame withDoubleVariables​(double[] doubles)
        Helper to copy this frame but with new double variables.
        Parameters:
        doubles - new doubles
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withObjectVariables

        public SerializedState.Frame withObjectVariables​(java.lang.Object[] objects)
        Helper to copy this frame but with new object variables.
        Parameters:
        objects - new objects
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withContinuationIndexVariables

        public SerializedState.Frame withContinuationIndexVariables​(int[] continuationIndexes)
        Helper to copy this frame but with new variable continuation indexes.
        Parameters:
        continuationIndexes - new continuation indexes
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
        java.lang.IllegalArgumentException - if continuationIndexes points to out of bounds indexes within objects or if if continuationIndexes points to non-null indexes within objects
      • withOperands

        public SerializedState.Frame withOperands​(int[] ints,
                                                  float[] floats,
                                                  long[] longs,
                                                  double[] doubles,
                                                  java.lang.Object[] objects,
                                                  int[] continuationIndexes)
        Helper to copy this frame but with potentially new operands.
        Parameters:
        ints - new ints (or null if should be kept the same)
        floats - new floats (or null if should be kept the same)
        longs - new longs (or null if should be kept the same)
        doubles - new doubles (or null if should be kept the same)
        objects - new objects (or null if should be kept the same)
        continuationIndexes - new continuation indexes (or null if should be kept the same)
        Returns:
        new frame
        Throws:
        java.lang.IllegalArgumentException - if continuationIndexes points to out of bounds indexes within objects or if if continuationIndexes points to non-null indexes within objects
      • withIntOperands

        public SerializedState.Frame withIntOperands​(int[] ints)
        Helper to copy this frame but with new int operands.
        Parameters:
        ints - new ints
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withFloatOperands

        public SerializedState.Frame withFloatOperands​(float[] floats)
        Helper to copy this frame but with new float operands.
        Parameters:
        floats - new floats
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withLongOperands

        public SerializedState.Frame withLongOperands​(long[] longs)
        Helper to copy this frame but with new long operands.
        Parameters:
        longs - new longs
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withDoubleOperands

        public SerializedState.Frame withDoubleOperands​(double[] doubles)
        Helper to copy this frame but with new double operands.
        Parameters:
        doubles - new doubles
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withObjectOperands

        public SerializedState.Frame withObjectOperands​(java.lang.Object[] objects)
        Helper to copy this frame but with new object operands.
        Parameters:
        objects - new objects
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withContinuationIndexOperands

        public SerializedState.Frame withContinuationIndexOperands​(int[] continuationIndexes)
        Helper to copy this frame but with new variable continuation indexes.
        Parameters:
        continuationIndexes - new continuation indexes
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
        java.lang.IllegalArgumentException - if continuationIndexes points to out of bounds indexes within objects or if if continuationIndexes points to non-null indexes within objects
      • withKey

        public SerializedState.Frame withKey​(java.lang.String className,
                                             java.lang.Integer methodId,
                                             java.lang.Integer continuationPointId)
        Helper to copy this frame but with a potentially new new class name / method ID / continuation point ID.
        Parameters:
        className - new class name (or null if should be kept the same)
        methodId - new method ID (or null if should be kept the same)
        continuationPointId - new continuation point ID (or null if should be kept the same)
        Returns:
        new frame
        Throws:
        java.lang.IllegalArgumentException - if continuationPointId < 0
      • withClassname

        public SerializedState.Frame withClassname​(java.lang.String className)
        Helper to copy this frame but with a new method ID.
        Parameters:
        className - new class name
        Returns:
        new frame
        Throws:
        java.lang.NullPointerException - if any argument is null
      • withMethodId

        public SerializedState.Frame withMethodId​(int methodId)
        Helper to copy this frame but with a new method ID.
        Parameters:
        methodId - new method ID
        Returns:
        new frame
      • withContinuationPointId

        public SerializedState.Frame withContinuationPointId​(int continuationPointId)
        Helper to copy this frame but with a new continuation point ID.
        Parameters:
        continuationPointId - new continuation point ID
        Returns:
        new frame
        Throws:
        java.lang.IllegalArgumentException - if continuationPointId < 0
      • validateState

        void validateState()