1 /**
2 * AUTOHIT 2003
3 * Copyright Erich P Gatejen (c) 1989,1997,2003,2004
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Additional license information can be found in the documentation.
19 * @author Erich P Gatejen
20 */
21 package autohit.vm;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25
26 import autohit.common.NVPair;
27
28 /**
29 * A VMExecutable is the holding bin for an executable.
30 * <p>
31 * When creating a new executable, you must call the init() member after construction.
32 * If you do not, you will eventually get an internal exception. If you are
33 * deserializing, don't worry about it.
34 * <p>
35 * @author Erich P. Gatejen
36 * @version 1.0
37 * <i>Version History</i>
38 * <code>EPG - Initial - 16apr03</code>
39 *
40 */
41 public class VMExecutable implements Serializable {
42
43 final static long serialVersionUID = 1;
44
45 /**
46 * An array containing an executable.
47 * Each member-object will be a vmInstruction derived class object.
48 *
49 * @see autohit.vm.i.VMInstruction
50 * @serial
51 */
52 public ArrayList core;
53
54 /**
55 * This executable name.
56 * @serial
57 */
58 public String name;
59
60 /**
61 * This executable UID. OPTIONAL
62 * @serial
63 */
64 public String uid;
65
66 /**
67 * This the type of executable.
68 * @serial
69 */
70 public String type;
71
72 /**
73 * Associated note.
74 * @serial
75 */
76 public String note;
77
78 /**
79 * Version major.
80 * @serial
81 */
82 public int major;
83
84 /**
85 * Version minor.
86 * @serial
87 */
88 public int minor;
89
90 /**
91 * Defines the output variable. The VM should load this to LEFT
92 * before returning, if it exists. The output is an name/value
93 * pair. The name is the name of the variable and the value is
94 * a type discriptor. The latter isn't always useful, but the former is
95 * required.
96 * @see autohit.common.NVPair
97 * @serial
98 */
99 public NVPair output;
100
101 // --- PUBLIC METHODS ----------------------------------------------------
102
103 /**
104 * Default Constructor. It will create an empty VMExecutable. Remember! If you are
105 * creating a new Sim, but sure to call init().
106 *
107 * @see #init()
108 */
109 public VMExecutable() {
110
111 }
112
113 /**
114 * Initializes a brand-new executable. Using this in case this has to be
115 * a singleton in the future.
116 */
117 public void init() {
118
119 core = new ArrayList();
120 }
121 }
|