Enum ArrayAccess

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ArrayAccess>

    public enum ArrayAccess
    extends java.lang.Enum<ArrayAccess>
    Allows accessing array values.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  ArrayAccess.Loader
      A stack manipulation for loading an array's value.
      protected class  ArrayAccess.Putter
      A stack manipulation for storing an array's value.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BYTE
      Access for a byte- or boolean-typed array.
      CHARACTER
      Access for a char-typed array.
      DOUBLE
      Access for a double-typed array.
      FLOAT
      Access for a float-typed array.
      INTEGER
      Access for a int-typed array.
      LONG
      Access for a long-typed array.
      REFERENCE
      Access for a reference-typed array.
      SHORT
      Access for a short-typed array.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int loadOpcode
      The opcode used for loading a value.
      private StackSize stackSize
      The size of the array's component value.
      private int storeOpcode
      The opcode used for storing a value.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ArrayAccess​(int loadOpcode, int storeOpcode, StackSize stackSize)
      Creates a new array access.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      StackManipulation forEach​(java.util.List<? extends StackManipulation> processInstructions)
      Applies a stack manipulation to the values of an array.
      StackManipulation load()
      Creates a value-loading stack manipulation.
      static ArrayAccess of​(TypeDefinition componentType)
      Locates an array accessor by the array's component type.
      StackManipulation store()
      Creates a value-storing stack manipulation.
      static ArrayAccess valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ArrayAccess[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • BYTE

        public static final ArrayAccess BYTE
        Access for a byte- or boolean-typed array.
      • SHORT

        public static final ArrayAccess SHORT
        Access for a short-typed array.
      • CHARACTER

        public static final ArrayAccess CHARACTER
        Access for a char-typed array.
      • INTEGER

        public static final ArrayAccess INTEGER
        Access for a int-typed array.
      • LONG

        public static final ArrayAccess LONG
        Access for a long-typed array.
      • FLOAT

        public static final ArrayAccess FLOAT
        Access for a float-typed array.
      • DOUBLE

        public static final ArrayAccess DOUBLE
        Access for a double-typed array.
      • REFERENCE

        public static final ArrayAccess REFERENCE
        Access for a reference-typed array.
    • Field Detail

      • loadOpcode

        private final int loadOpcode
        The opcode used for loading a value.
      • storeOpcode

        private final int storeOpcode
        The opcode used for storing a value.
      • stackSize

        private final StackSize stackSize
        The size of the array's component value.
    • Constructor Detail

      • ArrayAccess

        private ArrayAccess​(int loadOpcode,
                            int storeOpcode,
                            StackSize stackSize)
        Creates a new array access.
        Parameters:
        loadOpcode - The opcode used for loading a value.
        storeOpcode - The opcode used for storing a value.
        stackSize - The size of the array's component value.
    • Method Detail

      • values

        public static ArrayAccess[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ArrayAccess c : ArrayAccess.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ArrayAccess valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static ArrayAccess of​(TypeDefinition componentType)
        Locates an array accessor by the array's component type.
        Parameters:
        componentType - The array's component type.
        Returns:
        An array accessor for the given type.
      • load

        public StackManipulation load()
        Creates a value-loading stack manipulation.
        Returns:
        A value-loading stack manipulation.
      • store

        public StackManipulation store()
        Creates a value-storing stack manipulation.
        Returns:
        A value-storing stack manipulation.
      • forEach

        public StackManipulation forEach​(java.util.List<? extends StackManipulation> processInstructions)
        Applies a stack manipulation to the values of an array. The array must have at least as many values as the list has elements.
        Parameters:
        processInstructions - The elements to apply.
        Returns:
        A stack manipulation that applies the supplied instructions.