01: package demo.interceptors;
02:
03: import demo.interceptors.MyServerPackage.MyException;
04:
05: public class gridImpl extends MyServerPOA {
06: protected short height = 31;
07: protected short width = 14;
08: protected java.math.BigDecimal[][] mygrid;
09:
10: public gridImpl() {
11: mygrid = new java.math.BigDecimal[height][width];
12: for (short h = 0; h < height; h++)
13: for (short w = 0; w < width; w++)
14: mygrid[h][w] = new java.math.BigDecimal("0.21");
15: }
16:
17: public java.math.BigDecimal get(short n, short m) {
18: if ((n <= height) && (m <= width))
19: return mygrid[n][m];
20: else
21: return new java.math.BigDecimal("0.01");
22: }
23:
24: public short height() {
25: // System.out.println("height: " + height );
26: return height;
27: }
28:
29: public void set(short n, short m, java.math.BigDecimal value) {
30: if ((n <= height) && (m <= width))
31: mygrid[n][m] = value;
32: }
33:
34: public short width() {
35: return width;
36: }
37:
38: public short opWithException() throws MyException {
39: throw new MyException(
40: "This is only a test exception, no harm done :-)");
41: }
42:
43: }
|