# Class InstructionConst

java.lang.Object
org.apache.bcel.generic.InstructionConst

public final class InstructionConst extends Object
Contains shareable instruction objects.

In order to save memory you can use some instructions multiply, since they have an immutable state and are directly derived from Instruction. I.e. they have no instance fields that could be changed. Since some of these instructions like ICONST_0 occur very frequently this can save a lot of time and space. This feature is an adaptation of the FlyWeight design pattern, we just use an array instead of a factory.

The Instructions can also accessed directly under their names, so it's possible to write il.append(Instruction.ICONST_0);

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ArrayInstruction`
  `AALOAD`
  AALOAD instruction.
  `static final ArrayInstruction`
  `AASTORE`
  AASTORE instruction.
  `static final Instruction`
  `ACONST_NULL`
  ACONST_NULL instruction.
  `static final LocalVariableInstruction`
  `ALOAD_0`
  ALOAD_0 instruction (same as THIS).
  `static final LocalVariableInstruction`
  `ALOAD_1`
  ALOAD_1 instruction.
  `static final LocalVariableInstruction`
  `ALOAD_2`
  ALOAD_2 instruction.
  `static final ReturnInstruction`
  `ARETURN`
  ARETURN instruction.
  `static final Instruction`
  `ARRAYLENGTH`
  ARRAYLENGTH instruction.
  `static final LocalVariableInstruction`
  `ASTORE_0`
  ASTORE_0 instruction.
  `static final LocalVariableInstruction`
  `ASTORE_1`
  ASTORE_1 instruction.
  `static final LocalVariableInstruction`
  `ASTORE_2`
  ASTORE_2 instruction.
  `static final Instruction`
  `ATHROW`
  ATHROW instruction.
  `static final ArrayInstruction`
  `BALOAD`
  BALOAD instruction.
  `static final ArrayInstruction`
  `BASTORE`
  BASTORE instruction.
  `static final ArrayInstruction`
  `CALOAD`
  CALOAD instruction.
  `static final ArrayInstruction`
  `CASTORE`
  CASTORE instruction.
  `static final ConversionInstruction`
  `D2F`
  D2F instruction.
  `static final ConversionInstruction`
  `D2I`
  D2I instruction.
  `static final ConversionInstruction`
  `D2L`
  D2L instruction.
  `static final ArithmeticInstruction`
  `DADD`
  DADD instruction.
  `static final ArrayInstruction`
  `DALOAD`
  DALOAD instruction.
  `static final ArrayInstruction`
  `DASTORE`
  DASTORE instruction.
  `static final Instruction`
  `DCMPG`
  DCMPG instruction.
  `static final Instruction`
  `DCMPL`
  DCMPL instruction.
  `static final Instruction`
  `DCONST_0`
  DCONST_0 instruction.
  `static final Instruction`
  `DCONST_1`
  DCONST_1 instruction.
  `static final ArithmeticInstruction`
  `DDIV`
  DDIV instruction.
  `static final ArithmeticInstruction`
  `DMUL`
  DMUL instruction.
  `static final ArithmeticInstruction`
  `DNEG`
  DNEG instruction.
  `static final ArithmeticInstruction`
  `DREM`
  DREM instruction.
  `static final ReturnInstruction`
  `DRETURN`
  DRETURN instruction.
  `static final ArithmeticInstruction`
  `DSUB`
  DSUB instruction.
  `static final StackInstruction`
  `DUP`
  DUP instruction.
  `static final StackInstruction`
  `DUP_X1`
  DUP_X1 instruction.
  `static final StackInstruction`
  `DUP_X2`
  DUP_X2 instruction.
  `static final StackInstruction`
  `DUP2`
  DUP2 instruction.
  `static final StackInstruction`
  `DUP2_X1`
  DUP2_X1 instruction.
  `static final StackInstruction`
  `DUP2_X2`
  DUP2_X2 instruction.
  `static final ConversionInstruction`
  `F2D`
  F2D instruction.
  `static final ConversionInstruction`
  `F2I`
  F2I instruction.
  `static final ConversionInstruction`
  `F2L`
  F2L instruction.
  `static final ArithmeticInstruction`
  `FADD`
  FADD instruction.
  `static final ArrayInstruction`
  `FALOAD`
  FALOAD instruction.
  `static final ArrayInstruction`
  `FASTORE`
  FASTORE instruction.
  `static final Instruction`
  `FCMPG`
  FCMPG instruction.
  `static final Instruction`
  `FCMPL`
  FCMPL instruction.
  `static final Instruction`
  `FCONST_0`
  FCONST_0 instruction.
  `static final Instruction`
  `FCONST_1`
  FCONST_1 instruction.
  `static final Instruction`
  `FCONST_2`
  FCONST_2 instruction.
  `static final ArithmeticInstruction`
  `FDIV`
  FDIV instruction.
  `static final ArithmeticInstruction`
  `FMUL`
  FMUL instruction.
  `static final ArithmeticInstruction`
  `FNEG`
  FNEG instruction.
  `static final ArithmeticInstruction`
  `FREM`
  FREM instruction.
  `static final ReturnInstruction`
  `FRETURN`
  FRETURN instruction.
  `static final ArithmeticInstruction`
  `FSUB`
  FSUB instruction.
  `static final ConversionInstruction`
  `I2B`
  I2B instruction.
  `static final ConversionInstruction`
  `I2C`
  I2C instruction.
  `static final ConversionInstruction`
  `I2D`
  I2D instruction.
  `static final ConversionInstruction`
  `I2F`
  I2F instruction.
  `static final ConversionInstruction`
  `I2L`
  I2L instruction.
  `static final ConversionInstruction`
  `I2S`
  I2S instruction.
  `static final ArithmeticInstruction`
  `IADD`
  IADD instruction.
  `static final ArrayInstruction`
  `IALOAD`
  IALOAD instruction.
  `static final ArithmeticInstruction`
  `IAND`
  IAND instruction.
  `static final ArrayInstruction`
  `IASTORE`
  IASTORE instruction.
  `static final Instruction`
  `ICONST_0`
  ICONST_0 instruction.
  `static final Instruction`
  `ICONST_1`
  ICONST_1 instruction.
  `static final Instruction`
  `ICONST_2`
  ICONST_2 instruction.
  `static final Instruction`
  `ICONST_3`
  ICONST_3 instruction.
  `static final Instruction`
  `ICONST_4`
  ICONST_4 instruction.
  `static final Instruction`
  `ICONST_5`
  ICONST_5 instruction.
  `static final Instruction`
  `ICONST_M1`
  ICONST_M1 instruction.
  `static final ArithmeticInstruction`
  `IDIV`
  IDIV instruction.
  `static final LocalVariableInstruction`
  `ILOAD_0`
  ILOAD_0 instruction.
  `static final LocalVariableInstruction`
  `ILOAD_1`
  ILOAD_1 instruction.
  `static final LocalVariableInstruction`
  `ILOAD_2`
  ILOAD_2 instruction.
  `static final ArithmeticInstruction`
  `IMUL`
  IMUL instruction.
  `static final ArithmeticInstruction`
  `INEG`
  INEG instruction.
  `static final ArithmeticInstruction`
  `IOR`
  IOR instruction.
  `static final ArithmeticInstruction`
  `IREM`
  IREM instruction.
  `static final ReturnInstruction`
  `IRETURN`
  IRETURN instruction.
  `static final ArithmeticInstruction`
  `ISHL`
  ISHL instruction.
  `static final ArithmeticInstruction`
  `ISHR`
  ISHR instruction.
  `static final LocalVariableInstruction`
  `ISTORE_0`
  ISTORE_0 instruction.
  `static final LocalVariableInstruction`
  `ISTORE_1`
  ISTORE_1 instruction.
  `static final LocalVariableInstruction`
  `ISTORE_2`
  ISTORE_2 instruction.
  `static final ArithmeticInstruction`
  `ISUB`
  ISUB instruction.
  `static final ArithmeticInstruction`
  `IUSHR`
  IUSHR instruction.
  `static final ArithmeticInstruction`
  `IXOR`
  IXOR instruction.
  `static final ConversionInstruction`
  `L2D`
  L2D instruction.
  `static final ConversionInstruction`
  `L2F`
  L2F instruction.
  `static final ConversionInstruction`
  `L2I`
  L2I instruction.
  `static final ArithmeticInstruction`
  `LADD`
  LADD instruction.
  `static final ArrayInstruction`
  `LALOAD`
  LALOAD instruction.
  `static final ArithmeticInstruction`
  `LAND`
  LAND instruction.
  `static final ArrayInstruction`
  `LASTORE`
  LASTORE instruction.
  `static final Instruction`
  `LCMP`
  LCMP instruction.
  `static final Instruction`
  `LCONST_0`
  LCONST_0 instruction.
  `static final Instruction`
  `LCONST_1`
  LCONST_1 instruction.
  `static final ArithmeticInstruction`
  `LDIV`
  LDIV instruction.
  `static final ArithmeticInstruction`
  `LMUL`
  LMUL instruction.
  `static final ArithmeticInstruction`
  `LNEG`
  LNEG instruction.
  `static final ArithmeticInstruction`
  `LOR`
  LOR instruction.
  `static final ArithmeticInstruction`
  `LREM`
  LREM instruction.
  `static final ReturnInstruction`
  `LRETURN`
  LRETURN instruction.
  `static final ArithmeticInstruction`
  `LSHL`
  LSHL instruction.
  `static final ArithmeticInstruction`
  `LSHR`
  LSHR instruction.
  `static final ArithmeticInstruction`
  `LSUB`
  LSUB instruction.
  `static final ArithmeticInstruction`
  `LUSHR`
  LUSHR instruction.
  `static final ArithmeticInstruction`
  `LXOR`
  LXOR instruction.
  `static final Instruction`
  `MONITORENTER`
  MONITORENTER instruction.
  `static final Instruction`
  `MONITOREXIT`
  MONITOREXIT instruction.
  `static final Instruction`
  `NOP`
  NOP instruction.
  `static final StackInstruction`
  `POP`
  POP instruction.
  `static final StackInstruction`
  `POP2`
  POP2 instruction.
  `static final ReturnInstruction`
  `RETURN`
  RETURN instruction.
  `static final ArrayInstruction`
  `SALOAD`
  SALOAD instruction.
  `static final ArrayInstruction`
  `SASTORE`
  SASTORE instruction.
  `static final StackInstruction`
  `SWAP`
  SWAP instruction.
  `static final LocalVariableInstruction`
  `THIS`
  You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal values, for example call setIndex().

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Instruction`
  `getInstruction(int index)`
  Gets the Instruction.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NOP

    public static final Instruction NOP
    NOP instruction.

  - ### ACONST_NULL

    public static final Instruction ACONST_NULL
    ACONST_NULL instruction.

  - ### ICONST_M1

    public static final Instruction ICONST_M1
    ICONST_M1 instruction.

  - ### ICONST_0

    public static final Instruction ICONST_0
    ICONST_0 instruction.

  - ### ICONST_1

    public static final Instruction ICONST_1
    ICONST_1 instruction.

  - ### ICONST_2

    public static final Instruction ICONST_2
    ICONST_2 instruction.

  - ### ICONST_3

    public static final Instruction ICONST_3
    ICONST_3 instruction.

  - ### ICONST_4

    public static final Instruction ICONST_4
    ICONST_4 instruction.

  - ### ICONST_5

    public static final Instruction ICONST_5
    ICONST_5 instruction.

  - ### LCONST_0

    public static final Instruction LCONST_0
    LCONST_0 instruction.

  - ### LCONST_1

    public static final Instruction LCONST_1
    LCONST_1 instruction.

  - ### FCONST_0

    public static final Instruction FCONST_0
    FCONST_0 instruction.

  - ### FCONST_1

    public static final Instruction FCONST_1
    FCONST_1 instruction.

  - ### FCONST_2

    public static final Instruction FCONST_2
    FCONST_2 instruction.

  - ### DCONST_0

    public static final Instruction DCONST_0
    DCONST_0 instruction.

  - ### DCONST_1

    public static final Instruction DCONST_1
    DCONST_1 instruction.

  - ### IALOAD

    public static final ArrayInstruction IALOAD
    IALOAD instruction.

  - ### LALOAD

    public static final ArrayInstruction LALOAD
    LALOAD instruction.

  - ### FALOAD

    public static final ArrayInstruction FALOAD
    FALOAD instruction.

  - ### DALOAD

    public static final ArrayInstruction DALOAD
    DALOAD instruction.

  - ### AALOAD

    public static final ArrayInstruction AALOAD
    AALOAD instruction.

  - ### BALOAD

    public static final ArrayInstruction BALOAD
    BALOAD instruction.

  - ### CALOAD

    public static final ArrayInstruction CALOAD
    CALOAD instruction.

  - ### SALOAD

    public static final ArrayInstruction SALOAD
    SALOAD instruction.

  - ### IASTORE

    public static final ArrayInstruction IASTORE
    IASTORE instruction.

  - ### LASTORE

    public static final ArrayInstruction LASTORE
    LASTORE instruction.

  - ### FASTORE

    public static final ArrayInstruction FASTORE
    FASTORE instruction.

  - ### DASTORE

    public static final ArrayInstruction DASTORE
    DASTORE instruction.

  - ### AASTORE

    public static final ArrayInstruction AASTORE
    AASTORE instruction.

  - ### BASTORE

    public static final ArrayInstruction BASTORE
    BASTORE instruction.

  - ### CASTORE

    public static final ArrayInstruction CASTORE
    CASTORE instruction.

  - ### SASTORE

    public static final ArrayInstruction SASTORE
    SASTORE instruction.

  - ### POP

    public static final StackInstruction POP
    POP instruction.

  - ### POP2

    public static final StackInstruction POP2
    POP2 instruction.

  - ### DUP

    public static final StackInstruction DUP
    DUP instruction.

  - ### DUP_X1

    public static final StackInstruction DUP_X1
    DUP_X1 instruction.

  - ### DUP_X2

    public static final StackInstruction DUP_X2
    DUP_X2 instruction.

  - ### DUP2

    public static final StackInstruction DUP2
    DUP2 instruction.

  - ### DUP2_X1

    public static final StackInstruction DUP2_X1
    DUP2_X1 instruction.

  - ### DUP2_X2

    public static final StackInstruction DUP2_X2
    DUP2_X2 instruction.

  - ### SWAP

    public static final StackInstruction SWAP
    SWAP instruction.

  - ### IADD

    public static final ArithmeticInstruction IADD
    IADD instruction.

  - ### LADD

    public static final ArithmeticInstruction LADD
    LADD instruction.

  - ### FADD

    public static final ArithmeticInstruction FADD
    FADD instruction.

  - ### DADD

    public static final ArithmeticInstruction DADD
    DADD instruction.

  - ### ISUB

    public static final ArithmeticInstruction ISUB
    ISUB instruction.

  - ### LSUB

    public static final ArithmeticInstruction LSUB
    LSUB instruction.

  - ### FSUB

    public static final ArithmeticInstruction FSUB
    FSUB instruction.

  - ### DSUB

    public static final ArithmeticInstruction DSUB
    DSUB instruction.

  - ### IMUL

    public static final ArithmeticInstruction IMUL
    IMUL instruction.

  - ### LMUL

    public static final ArithmeticInstruction LMUL
    LMUL instruction.

  - ### FMUL

    public static final ArithmeticInstruction FMUL
    FMUL instruction.

  - ### DMUL

    public static final ArithmeticInstruction DMUL
    DMUL instruction.

  - ### IDIV

    public static final ArithmeticInstruction IDIV
    IDIV instruction.

  - ### LDIV

    public static final ArithmeticInstruction LDIV
    LDIV instruction.

  - ### FDIV

    public static final ArithmeticInstruction FDIV
    FDIV instruction.

  - ### DDIV

    public static final ArithmeticInstruction DDIV
    DDIV instruction.

  - ### IREM

    public static final ArithmeticInstruction IREM
    IREM instruction.

  - ### LREM

    public static final ArithmeticInstruction LREM
    LREM instruction.

  - ### FREM

    public static final ArithmeticInstruction FREM
    FREM instruction.

  - ### DREM

    public static final ArithmeticInstruction DREM
    DREM instruction.

  - ### INEG

    public static final ArithmeticInstruction INEG
    INEG instruction.

  - ### LNEG

    public static final ArithmeticInstruction LNEG
    LNEG instruction.

  - ### FNEG

    public static final ArithmeticInstruction FNEG
    FNEG instruction.

  - ### DNEG

    public static final ArithmeticInstruction DNEG
    DNEG instruction.

  - ### ISHL

    public static final ArithmeticInstruction ISHL
    ISHL instruction.

  - ### LSHL

    public static final ArithmeticInstruction LSHL
    LSHL instruction.

  - ### ISHR

    public static final ArithmeticInstruction ISHR
    ISHR instruction.

  - ### LSHR

    public static final ArithmeticInstruction LSHR
    LSHR instruction.

  - ### IUSHR

    public static final ArithmeticInstruction IUSHR
    IUSHR instruction.

  - ### LUSHR

    public static final ArithmeticInstruction LUSHR
    LUSHR instruction.

  - ### IAND

    public static final ArithmeticInstruction IAND
    IAND instruction.

  - ### LAND

    public static final ArithmeticInstruction LAND
    LAND instruction.

  - ### IOR

    public static final ArithmeticInstruction IOR
    IOR instruction.

  - ### LOR

    public static final ArithmeticInstruction LOR
    LOR instruction.

  - ### IXOR

    public static final ArithmeticInstruction IXOR
    IXOR instruction.

  - ### LXOR

    public static final ArithmeticInstruction LXOR
    LXOR instruction.

  - ### I2L

    public static final ConversionInstruction I2L
    I2L instruction.

  - ### I2F

    public static final ConversionInstruction I2F
    I2F instruction.

  - ### I2D

    public static final ConversionInstruction I2D
    I2D instruction.

  - ### L2I

    public static final ConversionInstruction L2I
    L2I instruction.

  - ### L2F

    public static final ConversionInstruction L2F
    L2F instruction.

  - ### L2D

    public static final ConversionInstruction L2D
    L2D instruction.

  - ### F2I

    public static final ConversionInstruction F2I
    F2I instruction.

  - ### F2L

    public static final ConversionInstruction F2L
    F2L instruction.

  - ### F2D

    public static final ConversionInstruction F2D
    F2D instruction.

  - ### D2I

    public static final ConversionInstruction D2I
    D2I instruction.

  - ### D2L

    public static final ConversionInstruction D2L
    D2L instruction.

  - ### D2F

    public static final ConversionInstruction D2F
    D2F instruction.

  - ### I2B

    public static final ConversionInstruction I2B
    I2B instruction.

  - ### I2C

    public static final ConversionInstruction I2C
    I2C instruction.

  - ### I2S

    public static final ConversionInstruction I2S
    I2S instruction.

  - ### LCMP

    public static final Instruction LCMP
    LCMP instruction.

  - ### FCMPL

    public static final Instruction FCMPL
    FCMPL instruction.

  - ### FCMPG

    public static final Instruction FCMPG
    FCMPG instruction.

  - ### DCMPL

    public static final Instruction DCMPL
    DCMPL instruction.

  - ### DCMPG

    public static final Instruction DCMPG
    DCMPG instruction.

  - ### IRETURN

    public static final ReturnInstruction IRETURN
    IRETURN instruction.

  - ### LRETURN

    public static final ReturnInstruction LRETURN
    LRETURN instruction.

  - ### FRETURN

    public static final ReturnInstruction FRETURN
    FRETURN instruction.

  - ### DRETURN

    public static final ReturnInstruction DRETURN
    DRETURN instruction.

  - ### ARETURN

    public static final ReturnInstruction ARETURN
    ARETURN instruction.

  - ### RETURN

    public static final ReturnInstruction RETURN
    RETURN instruction.

  - ### ARRAYLENGTH

    public static final Instruction ARRAYLENGTH
    ARRAYLENGTH instruction.

  - ### ATHROW

    public static final Instruction ATHROW
    ATHROW instruction.

  - ### MONITORENTER

    public static final Instruction MONITORENTER
    MONITORENTER instruction.

  - ### MONITOREXIT

    public static final Instruction MONITOREXIT
    MONITOREXIT instruction.

  - ### THIS

    public static final LocalVariableInstruction THIS
    You can use these constants in multiple places safely, if you can guarantee that you will never alter their internal values, for example call setIndex(). THIS instruction (ALOAD_0)

  - ### ALOAD_0

    public static final LocalVariableInstruction ALOAD_0
    ALOAD_0 instruction (same as THIS).

  - ### ALOAD_1

    public static final LocalVariableInstruction ALOAD_1
    ALOAD_1 instruction.

  - ### ALOAD_2

    public static final LocalVariableInstruction ALOAD_2
    ALOAD_2 instruction.

  - ### ILOAD_0

    public static final LocalVariableInstruction ILOAD_0
    ILOAD_0 instruction.

  - ### ILOAD_1

    public static final LocalVariableInstruction ILOAD_1
    ILOAD_1 instruction.

  - ### ILOAD_2

    public static final LocalVariableInstruction ILOAD_2
    ILOAD_2 instruction.

  - ### ASTORE_0

    public static final LocalVariableInstruction ASTORE_0
    ASTORE_0 instruction.

  - ### ASTORE_1

    public static final LocalVariableInstruction ASTORE_1
    ASTORE_1 instruction.

  - ### ASTORE_2

    public static final LocalVariableInstruction ASTORE_2
    ASTORE_2 instruction.

  - ### ISTORE_0

    public static final LocalVariableInstruction ISTORE_0
    ISTORE_0 instruction.

  - ### ISTORE_1

    public static final LocalVariableInstruction ISTORE_1
    ISTORE_1 instruction.

  - ### ISTORE_2

    public static final LocalVariableInstruction ISTORE_2
    ISTORE_2 instruction.

- ## Method Details

  - ### getInstruction

    public static Instruction getInstruction(int index)
    Gets the Instruction.
    Parameters:
      `index` - the index, for example `Const.RETURN`.
    Returns:
      the entry from the private INSTRUCTIONS table.