package org.jacorb.demo.grid;
/**
* A very simple implementation of a 2-D grid
*/
public class GridImpl
extends MyServerPOA
{
private boolean shutdown;
protected short height = 31;
protected short width = 14;
protected java.math.BigDecimal[][] mygrid;
public GridImpl()
{
mygrid = new java.math.BigDecimal[height][width];
for( short h = 0; h < height; h++ )
{
for( short w = 0; w < width; w++ )
{
mygrid[h][w] = new java.math.BigDecimal("123.21");
}
}
}
public java.math.BigDecimal get(short n, short m)
{
if( ( n <= height ) && ( m <= width ) )
{
return mygrid[n][m];
}
else
{
return new java.math.BigDecimal("123.01");
}
}
public short height()
{
return height;
}
public void set(short n, short m, java.math.BigDecimal value)
{
if( ( n <= height ) && ( m <= width ) )
{
mygrid[n][m] = value;
}
}
public short width()
{
return width;
}
public short opWithException()
throws org.jacorb.demo.grid.MyServerPackage.MyException
{
throw new org.jacorb.demo.grid.MyServerPackage.MyException("This is only a test exception, no harm done :-)");
}
public void shutdown ()
{
shutdown = true;
}
public boolean getShutdown ()
{
return shutdown;
}
}