persistable sclass SubMatrix extends AbstractMatrix {
Matrix matrix;
int x1, y1;
*(Matrix *matrix, Rect r) {
super(r.w, r.h);
x1 = r.x; y1 = r.y;
}
// currently no range checks
public A get(int x, int y) { ret matrix.get(x-x1, y-y1); }
public void set(int x, int y, A a) { matrix.set(x-x1, y-y1, a); }
}