Source code: com/chaoswg/xtc4y/classdesc/code/instructions/NewArray.java
1 //$Header: /cvsroot/xtc4y/xtc4y/src/com/chaoswg/xtc4y/classdesc/code/instructions/NewArray.java,v 1.1 2003/08/26 12:36:11 toggm Exp $
2 /******************************************************************************
3 * XTC4y - eXtreme Testing Collection 4 you *
4 * -------------------------------------------------------------------------- *
5 * URL: http://www.chaoswg.com/xtc4y *
6 * Author: Mike Toggweiler (2.dog@gmx.ch) *
7 * *
8 * Last Updated: $Date: 2003/08/26 12:36:11 $, by $Author: toggm $ *
9 * Version: $Revision: 1.1 $ *
10 * -------------------------------------------------------------------------- *
11 * COPYRIGHT: (c) 2003 by Mike Toggweiler *
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 *****************************************************************************/
18 package com.chaoswg.xtc4y.classdesc.code.instructions;
19
20 import java.io.DataInputStream;
21 import java.io.DataOutputStream;
22 import java.io.IOException;
23
24 import com.chaoswg.xtc4y.classdesc.ConstantPool;
25 import com.chaoswg.xtc4y.classdesc.code.Code;
26
27 /**
28 * A newarray instruction instanciate a array
29 * @author Mike Toggweiler
30 **/
31 public class NewArray extends WideBinaryInstruction {
32
33 public static final byte T_BOOLEAN = (byte)4;
34 public static final byte T_CHAR = (byte)5;
35 public static final byte T_FLOAT = (byte)6;
36 public static final byte T_DOUBLE = (byte)7;
37 public static final byte T_BYTE = (byte)8;
38 public static final byte T_SHORT = (byte)9;
39 public static final byte T_INT = (byte)10;
40 public static final byte T_LONG = (byte)11;
41
42 /**
43 * Create a newarray instruction
44 * @param dis the DataInputStream to read from
45 * @param cp the constant pool to resolve indices
46 **/
47 protected NewArray(DataInputStream dis,
48 ConstantPool cp) throws IOException {
49 super(NEWARRAY, dis, cp);
50 }
51
52 /**
53 * Create a newarray instruction with a byte specifiying the type
54 * of the array
55 * @param type the array type
56 **/
57 public NewArray(short type) {
58 super(NEWARRAY);
59 handleOperand(type, null);
60 }
61 }