if (!isLayoutValid(axis)) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequirements(axis, requirements[axis]); }
updateRequirements(axis);
  public float getPreferredSpan(int axis)  {    if (!isLayoutValid(axis))      {        if (axis == myAxis)          requirements[axis] = calculateMajorAxisRequirements(axis,                                                           requirements[axis]);        else          requirements[axis] = calculateMinorAxisRequirements(axis,                                                           requirements[axis]);      }    return requirements[axis].preferred;  }