function readGap(iGapStart, iGapEnd) {
			var oCache = oGapParent,
				mQueryOptions = oGapParent.getQueryOptions(),
				iStart = _Helper.getPrivateAnnotation(that.aElements[iGapStart], "index"),
				oStartElement = that.aElements[iGapStart];

			if (mQueryOptions.$count) { // $count not needed anymore, 1st read was done by #expand
				delete mQueryOptions.$count;
				oGapParent.setQueryOptions(mQueryOptions, true);
			}

			aReadPromises.push(
				oGapParent.read(iStart, iGapEnd - iGapStart, 0, oGroupLock.getUnlockedCopy(),
						fnDataRequested)
					.then(function (oResult) {
						var bGapHasMoved = false,
							oError;

						// Note: aElements[iGapStart] may have changed by a parallel operation
						if (oStartElement !== that.aElements[iGapStart]
								&& oResult.value[0] !== that.aElements[iGapStart]) {
							// start of the gap has moved meanwhile
							bGapHasMoved = true;
							iGapStart = that.aElements.indexOf(oStartElement);
							if (iGapStart < 0) {
								iGapStart = that.aElements.indexOf(oResult.value[0]);
								if (iGapStart < 0) {
									oError = new Error("Collapse before read has finished");
									oError.canceled = true;
									throw oError;
								}
							}
						}

						that.addElements(oResult.value, iGapStart, oCache, iStart);

						if (bGapHasMoved) {
							oError = new Error("Collapse or expand before read has finished");
							oError.canceled = true;
							throw oError;
						}
					}));
		}
/*
		 * Reads the given range of the current gap, saves the promise, and replaces the gap with
		 * the read's result.
		 *
		 * @param {number} iGapStart start of gap, inclusive
		 * @param {number} iGapEnd end of gap, exclusive
		 */
Reads the given range of the current gap, saves the promise, and replaces the gap with
the read's result.

@param {number} iGapStart start of gap, inclusive
@param {number} iGapEnd end of gap, exclusive
Reads the given range of the current gap saves the promise and replaces the gap with the read ' s result . @param { number } iGapStart start of gap inclusive @param { number } iGapEnd end of gap exclusive
function readGap(iGapStart, iGapEnd) {
			var oCache = oGapParent,
				mQueryOptions = oGapParent.getQueryOptions(),
				iStart = _Helper.getPrivateAnnotation(that.aElements[iGapStart], "index"),
				oStartElement = that.aElements[iGapStart];
			if (mQueryOptions.$count) { 
				delete mQueryOptions.$count;
				oGapParent.setQueryOptions(mQueryOptions, true);
			}
			aReadPromises.push(
				oGapParent.read(iStart, iGapEnd - iGapStart, 0, oGroupLock.getUnlockedCopy(),
						fnDataRequested)
					.then(function (oResult) {
						var bGapHasMoved = false,
							oError;
						if (oStartElement !== that.aElements[iGapStart]
								&& oResult.value[0] !== that.aElements[iGapStart]) {
							bGapHasMoved = true;
							iGapStart = that.aElements.indexOf(oStartElement);
							if (iGapStart < 0) {
								iGapStart = that.aElements.indexOf(oResult.value[0]);
								if (iGapStart < 0) {
									oError = new Error("Collapse before read has finished");
									oError.canceled = true;
									throw oError;
								}
							}
						}
						that.addElements(oResult.value, iGapStart, oCache, iStart);
						if (bGapHasMoved) {
							oError = new Error("Collapse or expand before read has finished");
							oError.canceled = true;
							throw oError;
						}
					}));
		}
function readGap ( iGapStart , iGapEnd ) { var oCache = oGapParent , mQueryOptions = oGapParent . getQueryOptions ( ) , iStart = _Helper . getPrivateAnnotation ( that . aElements [ iGapStart ] , "index" ) , oStartElement = that . aElements [ iGapStart ] ; if ( mQueryOptions . $count ) { delete mQueryOptions . $count ; oGapParent . setQueryOptions ( mQueryOptions , true ) ; } aReadPromises . push ( oGapParent . read ( iStart , iGapEnd - iGapStart , 0 , oGroupLock . getUnlockedCopy ( ) , fnDataRequested ) . then ( function ( oResult ) { var bGapHasMoved = false , oError ; if ( oStartElement !== that . aElements [ iGapStart ] && oResult . value [ 0 ] !== that . aElements [ iGapStart ] ) { bGapHasMoved = true ; iGapStart = that . aElements . indexOf ( oStartElement ) ; if ( iGapStart < 0 ) { iGapStart = that . aElements . indexOf ( oResult . value [ 0 ] ) ; if ( iGapStart < 0 ) { oError = new Error ( "Collapse before read has finished" ) ; oError . canceled = true ; throw oError ; } } } that . addElements ( oResult . value , iGapStart , oCache , iStart ) ; if ( bGapHasMoved ) { oError = new Error ( "Collapse or expand before read has finished" ) ; oError . canceled = true ; throw oError ; } } ) ) ; }
Reads the given range of the current gap, saves the promise, and replaces the gap with
 the read's result.
Reads the given range of the current gap saves the promise and replaces the gap with the read ' s result .
// $count not needed anymore, 1st read was done by #expand // Note: aElements[iGapStart] may have changed by a parallel operation // start of the gap has moved meanwhile