private int findFreeOrdinal ( int preferredOrdinal ) { if ( preferredOrdinal != - 1 && unusedPreviousOrdinals . get ( preferredOrdinal ) ) { unusedPreviousOrdinals . clear ( preferredOrdinal ) ; return preferredOrdinal ; } return freeOrdinalTracker . getFreeOrdinal ( ) ; }
If the preferredOrdinal has not already been used mark it and use it . Otherwise delegate to the FreeOrdinalTracker .