Enum ArrayAccess
- All Implemented Interfaces:
Serializable
,Comparable<ArrayAccess>
,java.lang.constant.Constable
Allows accessing array values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A stack manipulation for loading an array's value.protected class
A stack manipulation for storing an array's value.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAccess for abyte
- orboolean
-typed array.Access for achar
-typed array.Access for adouble
-typed array.Access for afloat
-typed array.Access for aint
-typed array.Access for along
-typed array.Access for a reference-typed array.Access for ashort
-typed array. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The opcode used for loading a value.private final StackSize
The size of the array's component value.private final int
The opcode used for storing a value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ArrayAccess
(int loadOpcode, int storeOpcode, StackSize stackSize) Creates a new array access. -
Method Summary
Modifier and TypeMethodDescriptionforEach
(List<? extends StackManipulation> processInstructions) Applies a stack manipulation to the values of an array.load()
Creates a value-loading stack manipulation.static ArrayAccess
of
(TypeDefinition componentType) Locates an array accessor by the array's component type.store()
Creates a value-storing stack manipulation.static ArrayAccess
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.
-
Enum Constant Details
-
BYTE
Access for abyte
- orboolean
-typed array. -
SHORT
Access for ashort
-typed array. -
CHARACTER
Access for achar
-typed array. -
INTEGER
Access for aint
-typed array. -
LONG
Access for along
-typed array. -
FLOAT
Access for afloat
-typed array. -
DOUBLE
Access for adouble
-typed array. -
REFERENCE
Access for a reference-typed array.
-
-
Field Details
-
loadOpcode
private final int loadOpcodeThe opcode used for loading a value. -
storeOpcode
private final int storeOpcodeThe opcode used for storing a value. -
stackSize
The size of the array's component value.
-
-
Constructor Details
-
ArrayAccess
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 Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
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
Creates a value-loading stack manipulation.- Returns:
- A value-loading stack manipulation.
-
store
Creates a value-storing stack manipulation.- Returns:
- A value-storing stack manipulation.
-
forEach
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.
-