Repositions the low-level layer to read from the specified index.

@param reqIndex
Index to position the file pointer to.
4547
protected synchronized void navigateToIndex(int reqIndex)
			throws IOException {
		// determine if navigation is necessary
		if (reqIndex != index) {
			// ensure that the requested index is valid
			if (reqIndex < 0 || reqIndex >= size) {
				throw new IndexOutOfBoundsException();
			}
			// navigate to requested index in file
			if (reqIndex > index) {
				// forward navigation
				skipForward(reqIndex - index);
			} else {
				// backward navigation
				int backSkips = index - reqIndex;
				if (backSkips < (index / 2)) {
					// check if current index is beyond valid list
					if (index == size) {
						// reset current position to last element in
						// set and adjust index and skip counter.
						index = (size - 1);
						position = lastInsertPosition;
						backSkips = index - reqIndex;
					}
					// move in backward direction
					skipBackward(backSkips);
				} else {
					// it is faster to reset position to the beginning
					// of the file and move forward from there to the
					// requested index
					resetPosition();
					skipForward(reqIndex);
				}
			}
		}
		if (reqIndex != index) {
			throw new IOException("Navigation fault! (required: " + reqIndex
					+ ", yielded: " + index + ")");
		}
	}
618618
protected void ensureRestrictedIndex(final int index) {
        if (index < 0) throw new IndexOutOfBoundsException("Index (" + index + ") is negative");
        if (index >= size())
            throw new IndexOutOfBoundsException("Index (" + index + ") is greater than or equal to list size (" + (size()) + ")");
    }
1157661
private static void updatePartialIndex(IndexScanPlanNode scan) {
        if (scan.getPredicate() == null && scan.getPartialIndexPredicate() != null) {
            if (scan.isForSortOrderOnly()) {
                scan.setPredicate(Collections.singletonList(scan.getPartialIndexPredicate()));
            }
            scan.setForPartialIndexOnly();
        }
    }
1349229
def set_index(self, index):
        
        self.setCurrentIndex(index)
        self.new_root.emit(index)
        self.scrollTo(index)
257150
public function reindex()
    {
        if ($this->index_field !== null) {
            $this->objects_by_index = array();
            $index_field = $this->index_field;
            foreach ($this->objects as $object) {
                if (isset($object->$index_field)) {
                    $this->objects_by_index[$object->$index_field] = $object;
                }
            }
        }
    }
1341585
public InvocationBuilder setReplicaIndex(int replicaIndex) {
        if (replicaIndex < 0 || replicaIndex >= InternalPartition.MAX_REPLICA_COUNT) {
            throw new IllegalArgumentException("Replica index is out of range [0-"
                    + (InternalPartition.MAX_REPLICA_COUNT - 1) + "]");
        }
        this.replicaIndex = replicaIndex;
        return this;
    }
38857
public void putIndex(IndexRecord rec, int partition) {
    final int pos = partition * MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH / 8;
    entries.put(pos, rec.startOffset);
    entries.put(pos + 1, rec.rawLength);
    entries.put(pos + 2, rec.partLength);
  }
795302
protected void setMapLayerAt(int index, L layer) {
		this.subLayers.set(index, layer);
		layer.setContainer(this);
		resetBoundingBox();
	}
834881
void resetTail(long index) {
    for (SegmentedJournalReader reader : readers) {
      if (reader.getNextIndex() >= index) {
        reader.reset(index);
      }
    }
  }
1048718
public final void seek(long pPosition) throws IOException {
        checkOpen();

        // TODO: This is correct according to javax.imageio (IndexOutOfBoundsException),
        // but it's inconsistent with reset that throws IOException...
        if (pPosition < flushedPosition) {
            throw new IndexOutOfBoundsException("position < flushedPosition!");
        }

        seekImpl(pPosition);
        position = pPosition;
    }
586
protected void reallocateIndexes() {
        if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) {
            this.indexes = new int[getFilteredModel().getSize()];
        }
        applyConstraint();
    }
1232097
def _reindex(self):
        
        self.index = []
        for path in self.paths:
            target_path = os.path.normpath(os.path.join(BASE_PATH,
                                                        path))
            for root, subdirs, files in os.walk(target_path):
                for f in files:
                    self.index.append(
                        (os.path.join(root, f).lower(),
                         os.path.join(root, f)))
927277
@Override
	public void setReadPosition(long pointer) {
		final int bufferNum = (int) (pointer >>> this.segmentSizeBits);
		final int offset = (int) (pointer & segmentSizeMask);

		this.currentBufferNum = bufferNum;

		seekInput(this.partitionBuffers[bufferNum], offset,
				bufferNum < partitionBuffers.length - 1 ? segmentSize : finalBufferLimit);
	}
1142487
private void moveDataAfterIndex(int index, int length) {
		ensureCapacity(Math.max(this.position, index) + length);
		if (index < this.position) {
			// 插入位置在已有数据范围内，后移插入位置之后的数据
			System.arraycopy(this.value, index, this.value, index + length, this.position - index);
		} else if (index > this.position) {
			// 插入位置超出范围，则当前位置到index清除为空格
			Arrays.fill(this.value, this.position, index, StrUtil.C_SPACE);
		}
		// 不位移
	}
1087515
protected void setParseInformation(int index, int start) {
        this.buffIndex = index;
        this.offset = start;

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Set parse information " + this.buffIndex + " " + this.offset);
        }
    }
1336031
private void recordIndex(int index) {
        stateLock.writeLock().lock();
        try {
            int insertionPoint = -Arrays.binarySearch(effectiveIndex, index) - 1;
            System.arraycopy(effectiveIndex, insertionPoint, effectiveIndex, insertionPoint + 1, effectiveIndex.length - insertionPoint - 1);
            effectiveIndex[insertionPoint] = index;
        } finally {
            stateLock.writeLock().unlock();
        }
    }
406050
public void removeValue(int index) {

        m_content.removeValue(getPath(), getLocale(), index);

        // re-initialize the value list
        m_values = m_content.getValues(getPath(), getLocale());
    }