Interface Frame

  • All Known Subinterfaces:
    MaterializedFrame, VirtualFrame

    public interface Frame
    Represents a frame containing values of local variables of the guest language. Instances of this type must not be stored in a field or cast to Object.
    • Method Detail

      • getFrameDescriptor

        FrameDescriptor getFrameDescriptor()
        Returns:
        the object describing the layout of this frame
      • getArguments

        java.lang.Object[] getArguments()
        Retrieves the arguments object from this frame. The runtime assumes that the arguments object is never null.
        Returns:
        the arguments used when calling this method
      • getObject

        java.lang.Object getObject​(FrameSlot slot)
                            throws FrameSlotTypeException
        Read access to a local variable of type Object.
        Parameters:
        slot - the slot of the local variable
        Returns:
        the current value of the local variable
        Throws:
        FrameSlotTypeException
      • setObject

        void setObject​(FrameSlot slot,
                       java.lang.Object value)
        Write access to a local variable of type Object.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setByte

        void setByte​(FrameSlot slot,
                     byte value)
        Write access to a local variable of type byte.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setBoolean

        void setBoolean​(FrameSlot slot,
                        boolean value)
        Write access to a local variable of type boolean.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setInt

        void setInt​(FrameSlot slot,
                    int value)
        Write access to a local variable of type int.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setLong

        void setLong​(FrameSlot slot,
                     long value)
        Write access to a local variable of type long.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setFloat

        void setFloat​(FrameSlot slot,
                      float value)
        Write access to a local variable of type float.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • setDouble

        void setDouble​(FrameSlot slot,
                       double value)
        Write access to a local variable of type double.
        Parameters:
        slot - the slot of the local variable
        value - the new value of the local variable
      • getValue

        java.lang.Object getValue​(FrameSlot slot)
        Read access to a local variable of any type.
        Parameters:
        slot - the slot of the local variable
        Returns:
        the current value of the local variable or defaultValue if unset
      • materialize

        MaterializedFrame materialize()
        Materializes this frame, which allows it to be stored in a field or cast to Object. The frame however looses the ability to be packed or to access the caller frame.
        Returns:
        the new materialized frame
      • isObject

        boolean isObject​(FrameSlot slot)
        Check whether the given FrameSlot is of type object.
      • isByte

        boolean isByte​(FrameSlot slot)
        Check whether the given FrameSlot is of type byte.
      • isBoolean

        boolean isBoolean​(FrameSlot slot)
        Check whether the given FrameSlot is of type boolean.
      • isInt

        boolean isInt​(FrameSlot slot)
        Check whether the given FrameSlot is of type int.
      • isLong

        boolean isLong​(FrameSlot slot)
        Check whether the given FrameSlot is of type long.
      • isFloat

        boolean isFloat​(FrameSlot slot)
        Check whether the given FrameSlot is of type float.
      • isDouble

        boolean isDouble​(FrameSlot slot)
        Check whether the given FrameSlot is of type double.