@@ -0,0 +1,995 @@
+package sophomore.classfile.bytecode;%0A%0Aimport java.util.Arrays;%0A%0Aimport sophomore.classfile.ArrayInfo;%0A%0A/**%0A *%0A * @author inagaki%0A */%0Apublic class Opcodes implements ArrayInfo%3COpcodeInfo%3E %7B%0A%0A%09OpcodeInfo%5B%5D opcodes;%0A%09int position;%0A%0A%09public Opcodes(int size) %7B%0A%09%09this.opcodes = new OpcodeInfo%5Bsize%5D;%0A%09%09this.position = 0;%0A%09%7D%0A%0A%09public Opcodes() %7B%0A%09%09// default size is 10.%0A%09%09this(10);%0A%09%7D%0A%0A%09@Override%0A%09public int getSize() %7B%0A%09%09return opcodes.length;%0A%09%7D%0A%0A%09public void add(OpcodeInfo element) %7B%0A%09%09add(position, element);%0A%09%7D%0A%0A%09@Override%0A%09public void add(int index, OpcodeInfo element) %7B%0A%09%09if(index %3E= opcodes.length) %7B%0A%09%09%09this.opcodes = Arrays.copyOf(opcodes, opcodes.length+1, opcodes.getClass());%0A%09%09%7D%0A%09%09opcodes%5Bposition++%5D = element;%0A%09%7D%0A%0A%09@Override%0A%09public OpcodeInfo get(int index) %7B%0A%09%09if(index %3E= opcodes.length) %7B%0A%09%09%09throw new ArrayIndexOutOfBoundsException(index);%0A%09%09%7D%0A%09%09return opcodes%5Bindex%5D;%0A%09%7D%0A%0A%09@Override%0A%09public OpcodeInfo%5B%5D getAll() %7B%0A%09%09return Arrays.copyOfRange(opcodes, 0, position);%0A%09%7D%0A%09%0A%7D%0A

add class for opcode sequence.