question: @ Override public IScanListIterator < IEntryCacheInfo > establishScan ( K startPos , short relation , K endPos , boolean endPosInclusive , boolean ordered ) { ordered |= FORCE_ORDERED_SCAN ; long startTime = _recentExtendedIndexUpdates != null ? System . currentTimeMillis ( ) : 0 ; IScanListIterator < IEntryCacheInfo > res = ordered ? establishScanOrdered ( startPos , relation , endPos , endPosInclusive ) : establishScanUnOrdered ( startPos , relation , endPos , endPosInclusive ) ; if ( _recentExtendedIndexUpdates != null && ! _recentExtendedIndexUpdates . isEmpty ( ) ) { MultiStoredList < IEntryCacheInfo > msl = new MultiStoredList < IEntryCacheInfo > ( ) ; msl . add ( res ) ; msl . add ( _recentExtendedIndexUpdates . iterator ( startTime , ( ExtendedIndexIterator ) res ) ) ; return msl ; } else return res ; }
target:  establish a scan according to the relation given and startPos : the start-scan object ,  null means scan all values. The relation is from com.j_spaces.client.TemplateMatchCodes: LT, LE, GT, GE (other codes are not relevant) endPos- key up to (or null if no limit in  index) endPosInclusive : is the endPos up to (or down to) and including ? ordered - according to the condition. GT, GE ==> ascending, LT, LE =====> descending. returns an IOrderedIndexScan object which enables scanning the ordered index, Null if no relevant elements to scan