if (! layoutValid[axis])
if (axis != Y_AXIS && axis != X_AXIS) throw new IllegalArgumentException("Illegal axis: " + axis); if (! requirementsValid[axis])
  private void updateRequirements(int axis)  {    if (! layoutValid[axis])      {        if (axis == myAxis)          requirements[axis] = calculateMajorAxisRequirements(axis,                                                           requirements[axis]);        else          requirements[axis] = calculateMinorAxisRequirements(axis,                                                           requirements[axis]);      }  }