operator []= method
Implementation
void operator []=(int idx, double v) {
if (idx == 0) {
left = v;
} else if (idx == 1) {
top = v;
} else if (idx == 2) {
right = v;
} else if (idx == 3) {
bottom = v;
} else {
throw Exception('bad index');
}
}