01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General License, v2.1 or later
06: * $Id: TypesInstruction.java 3810 2007-06-25 13:36:58Z gbevin $
07: */
08: package com.uwyn.rife.continuations.instrument;
09:
10: import com.uwyn.rife.continuations.instrument.TypesOpcode;
11:
12: class TypesInstruction {
13: private byte mOpcode = -1;
14: private int mArgument = -1;
15: private String mType = null;
16:
17: TypesInstruction(byte opcode) {
18: mOpcode = opcode;
19: }
20:
21: TypesInstruction(byte opcode, String type) {
22: mOpcode = opcode;
23: mType = type;
24: }
25:
26: TypesInstruction(byte opcode, int argument) {
27: mOpcode = opcode;
28: mArgument = argument;
29: }
30:
31: TypesInstruction(byte opcode, int argument, String type) {
32: mOpcode = opcode;
33: mArgument = argument;
34: mType = type;
35: }
36:
37: byte getOpcode() {
38: return mOpcode;
39: }
40:
41: int getArgument() {
42: return mArgument;
43: }
44:
45: String getType() {
46: return mType;
47: }
48:
49: public String toString() {
50: StringBuilder result = new StringBuilder(TypesOpcode
51: .toString(mOpcode));
52: if (mArgument != -1) {
53: result.append(", ");
54: result.append(mArgument);
55: }
56: if (mType != null) {
57: result.append(", ");
58: result.append(mType);
59: }
60:
61: return result.toString();
62: }
63: }
|