TreeSet without JDK 6 method usages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1561511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e790281425
commit
bd3cd2243e
@ -123,15 +123,31 @@ public class ColumnHelper {
|
||||
if (col.equals(overrideColumn)) haveOverrideColumn = overrideColumn;
|
||||
while (currentIndex <= nextIndex && !currentElements.isEmpty()) {
|
||||
Set<CTCol> currentIndexElements = new HashSet<CTCol>();
|
||||
long currentElemIndex;
|
||||
|
||||
{
|
||||
// narrow scope of currentElem
|
||||
CTCol currentElem = currentElements.first();
|
||||
long currentElemIndex = currentElem.getMax();
|
||||
currentIndexElements.add(currentElem);
|
||||
while (currentElements.higher(currentElem) != null && currentElements.higher(currentElem).getMax() == currentElemIndex) {
|
||||
currentElem = currentElements.higher(currentElem);
|
||||
currentElemIndex = currentElem.getMax();
|
||||
currentIndexElements.add(currentElem);
|
||||
|
||||
for (CTCol cc : currentElements.tailSet(currentElem)) {
|
||||
if (cc == null || cc.getMax() == currentElemIndex) break;
|
||||
currentIndexElements.add(cc);
|
||||
if (col.getMax() > currentMax) currentMax = col.getMax();
|
||||
if (col.equals(overrideColumn)) haveOverrideColumn = overrideColumn;
|
||||
}
|
||||
|
||||
// JDK 6 code
|
||||
// while (currentElements.higher(currentElem) != null && currentElements.higher(currentElem).getMax() == currentElemIndex) {
|
||||
// currentElem = currentElements.higher(currentElem);
|
||||
// currentIndexElements.add(currentElem);
|
||||
// if (col.getMax() > currentMax) currentMax = col.getMax();
|
||||
// if (col.equals(overrideColumn)) haveOverrideColumn = overrideColumn;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
if (currentElemIndex < nextIndex || !flIter.hasNext()) {
|
||||
insertCol(cols, currentIndex, currentElemIndex, currentElements.toArray(new CTCol[]{}), true, haveOverrideColumn);
|
||||
if (flIter.hasNext()) {
|
||||
|
Loading…
Reference in New Issue
Block a user