Enum ArrayAccess
- java.lang.Object
-
- java.lang.Enum<ArrayAccess>
-
- net.bytebuddy.implementation.bytecode.collection.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 abyte
- orboolean
-typed array.CHARACTER
Access for achar
-typed array.DOUBLE
Access for adouble
-typed array.FLOAT
Access for afloat
-typed array.INTEGER
Access for aint
-typed array.LONG
Access for along
-typed array.REFERENCE
Access for a reference-typed array.SHORT
Access for ashort
-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.
-
-
-
Enum Constant Detail
-
BYTE
public static final ArrayAccess BYTE
Access for abyte
- orboolean
-typed array.
-
SHORT
public static final ArrayAccess SHORT
Access for ashort
-typed array.
-
CHARACTER
public static final ArrayAccess CHARACTER
Access for achar
-typed array.
-
INTEGER
public static final ArrayAccess INTEGER
Access for aint
-typed array.
-
LONG
public static final ArrayAccess LONG
Access for along
-typed array.
-
FLOAT
public static final ArrayAccess FLOAT
Access for afloat
-typed array.
-
DOUBLE
public static final ArrayAccess DOUBLE
Access for adouble
-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 namejava.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.
-
-