public void setIndex(int index) {
    if (myIndex != -1) {
      throw new IllegalStateException("Index is already set: old = " + myIndex + "; new = " + index);
    }
    myIndex = index;
  }
public void setIndex(int index)