operator []= method

void operator []=(
  1. int idx,
  2. double v
)

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');
  }
}