private static int getTotalSizeParallel(ArrayList<CompWrap> compWraps, int sType, boolean isHor) { int size = sType == LayoutUtil.MAX ? LayoutUtil.INF : 0; for (CompWrap cw : compWraps) { int cwSize = cw.getSizeInclGaps(sType, isHor); if (cwSize >= LayoutUtil.INF) return LayoutUtil.INF; if (sType == LayoutUtil.MAX ? cwSize < size : cwSize > size) size = cwSize; } return constrainSize(size); }
private static int getTotalGroupsSizeParallel(ArrayList<LinkedDimGroup> groups, int sType, boolean countSpanning) { int size = sType == LayoutUtil.MAX ? LayoutUtil.INF : 0; for (LinkedDimGroup group : groups) { if (countSpanning || group.span == 1) { int grpSize = group.getMinPrefMax()[sType]; if (grpSize >= LayoutUtil.INF) return LayoutUtil.INF; if (sType == LayoutUtil.MAX ? grpSize < size : grpSize > size) size = grpSize; } } return constrainSize(size); }
private static int getTotalSizeSerial(ArrayList<CompWrap> compWraps, int sType, boolean isHor) { int totSize = 0; for (int i = 0, iSz = compWraps.size(), lastGapAfter = 0; i < iSz; i++) { CompWrap wrap = compWraps.get(i); int gapBef = wrap.getGapBefore(sType, isHor); if (gapBef > lastGapAfter) totSize += gapBef - lastGapAfter; totSize += wrap.getSize(sType, isHor); totSize += (lastGapAfter = wrap.getGapAfter(sType, isHor)); if (totSize >= LayoutUtil.INF) return LayoutUtil.INF; } return constrainSize(totSize); }