sclass DoubleRect { double x, y, w, h; *() {} *(Rectangle r) { x = r.x; y = r.y; w = r.width; h = r.height; } *(double *x, double *y, double *w, double *h) {} // Huh. not implementing equals()/hashCode? Stefan is mysterious bool eq(O o) { if (!o instanceof DoubleRect) false; if (o == this) true; DoubleRect r = cast o; ret x == r.x && y == r.y && w == r.w && h == r.h; } toString { ret x + "," + y + " / " + w + "," + h; } double x1() { ret x; } double y1() { ret y; } double x2() { ret x + w; } double y2() { ret y + h; } bool contains(Pt p) { ret contains(p.x, p.y); } bool contains(double _x, double _y) { ret _x >= x && _y >= y && _x < x+w && _y < y+h; } bool empty() { ret w <= 0 || h <= 0; } }