1 |
ajm |
1.1 |
//---PACKAGE DECLARATION--- |
2 |
|
|
package uk.ac.ukc.iscream.client; |
3 |
|
|
|
4 |
|
|
//---IMPORTS--- |
5 |
|
|
import uk.ac.ukc.iscream.util.*; |
6 |
|
|
|
7 |
|
|
/** |
8 |
|
|
* Register class |
9 |
|
|
* |
10 |
|
|
* @author $Author: tdb1 $ |
11 |
|
|
* @version $Id: Alert.java,v 1.5 2001/03/02 00:35:50 tdb1 Exp $ |
12 |
|
|
*/ |
13 |
|
|
public class Register { |
14 |
|
|
|
15 |
|
|
//---FINAL ATTRIBUTES--- |
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* The current CVS revision of this class |
19 |
|
|
*/ |
20 |
|
|
public static final String REVISION = "$Revision: 1.5 $"; |
21 |
|
|
|
22 |
|
|
//---STATIC METHODS--- |
23 |
|
|
|
24 |
|
|
//---CONSTRUCTORS--- |
25 |
|
|
|
26 |
|
|
/** |
27 |
|
|
* Construct a Register |
28 |
|
|
* |
29 |
|
|
* @param size the size of the register |
30 |
|
|
*/ |
31 |
|
|
public Register(int size) { |
32 |
|
|
_register = new int[size]; |
33 |
|
|
for (int x = 0; x < _register.length; x++) { |
34 |
|
|
_register[x] = 0; |
35 |
|
|
} |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
//---PUBLIC METHODS--- |
39 |
|
|
|
40 |
|
|
//---PRIVATE METHODS--- |
41 |
|
|
|
42 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
43 |
|
|
|
44 |
|
|
public int getRegister(int register) { |
45 |
|
|
return _register[register]; |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
public void setRegister(int register, int value) { |
49 |
|
|
_register[register] = value; |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
//---ATTRIBUTES--- |
53 |
|
|
|
54 |
|
|
private int[] _register; |
55 |
|
|
|
56 |
|
|
//---STATIC ATTRIBUTES--- |
57 |
|
|
|
58 |
|
|
} |