Gets the min start position.

@param docId the doc id
@param position the position
@return the min start position
@throws IOException Signals that an I/O exception has occurred.
4460
public int getMinStartPosition(int docId, int position) throws IOException {
    if (ignoreSpans != null && docId == currentDocId) {
      if (position < minimumPosition) {
        throw new IOException(
            "Unexpected position, should be >= " + minimumPosition + "!");
      } else {
        computeFullStartPositionMinimum(position);
        if (minFullStartPosition.containsKey(position)) {
          return minFullStartPosition.get(position);
        } else {
          return 0;
        }
      }
    } else {
      return 0;
    }
  }
430414
private boolean goToNextStartPosition() throws IOException {
    int basicStartPositionMin;
    int basicStartPositionMax;
    int basicEndPosition;
    int basicEndPositionMin;
    int basicEndPositionMax;
    if (docId == -1 || docId == NO_MORE_DOCS) {
      throw new IOException("no document");
    } else {
      if (lastCollectedStartPosition < NO_MORE_POSITIONS
          && (collectedPositions.isEmpty()
              || (collectedPositions.firstKey() >= (lastCollectedStartPosition
                  - query.maximumLeft)))) {
        // collect new positions
        while ((lastCollectedStartPosition = subSpans
            .nextStartPosition()) != NO_MORE_POSITIONS) {
          basicEndPosition = subSpans.endPosition();
          basicStartPositionMin = Math.max(minPosition,
              lastCollectedStartPosition - query.maximumLeft);
          basicStartPositionMax = lastCollectedStartPosition
              - query.minimumLeft;
          basicEndPositionMin = basicEndPosition + query.minimumRight;
          basicEndPositionMax = Math.min(maxPosition + 1,
              basicEndPosition + query.maximumRight);
          for (int cLeft = basicStartPositionMin; cLeft <= basicStartPositionMax; cLeft++) {
            for (int cRight = basicEndPositionMin; cRight <= basicEndPositionMax; cRight++) {
              if (!collectedPositions.containsKey(cLeft)) {
                collectedPositions.put(cLeft, new ArrayList<Integer>());
              }
              collectedPositions.get(cLeft).add(cRight);
            }
          }
          if (!collectedPositions.isEmpty() && (collectedPositions
              .firstKey() < (lastCollectedStartPosition - query.maximumLeft))) {
            break;
          }
        }
      }
      if (collectedPositions.isEmpty()) {
        return false;
      } else {
        startPosition = collectedPositions.firstKey();
        endPosition = collectedPositions.get(startPosition).remove(0);
        if (collectedPositions.get(startPosition).isEmpty()) {
          collectedPositions.remove(startPosition);
        }
        return true;
      }
    }
  }
98721
public MtasToken getObjectById(String field, int docId, int mtasId)
      throws IOException {
    try {
      Long ref;
      Long objectRefApproxCorrection;
      IndexDoc doc = getDoc(field, docId);
      IndexInput inObjectId = indexInputList.get("indexObjectId");
      IndexInput inObject = indexInputList.get("object");
      IndexInput inTerm = indexInputList.get("term");
      if (doc.storageFlags == MtasCodecPostingsFormat.MTAS_STORAGE_BYTE) {
        inObjectId.seek(doc.fpIndexObjectId + (mtasId * 1L));
        objectRefApproxCorrection = Long.valueOf(inObjectId.readByte());
      } else if (doc.storageFlags == MtasCodecPostingsFormat.MTAS_STORAGE_SHORT) {
        inObjectId.seek(doc.fpIndexObjectId + (mtasId * 2L));
        objectRefApproxCorrection = Long.valueOf(inObjectId.readShort());
      } else if (doc.storageFlags == MtasCodecPostingsFormat.MTAS_STORAGE_INTEGER) {
        inObjectId.seek(doc.fpIndexObjectId + (mtasId * 4L));
        objectRefApproxCorrection = Long.valueOf(inObjectId.readInt());
      } else {
        inObjectId.seek(doc.fpIndexObjectId + (mtasId * 8L));
        objectRefApproxCorrection = Long.valueOf(inObjectId.readLong());
      }
      ref = objectRefApproxCorrection + doc.objectRefApproxOffset
          + (mtasId * (long) doc.objectRefApproxQuotient);
      return MtasCodecPostingsFormat.getToken(inObject, inTerm, ref);
    } catch (Exception e) {
      throw new IOException(e);
    }
  }
541361
protected String getTextEx(int position, int len)
    {
        try {
            return getDocument().getText(position, len);
        } catch (BadLocationException e) {
            e.printStackTrace();
            return "";
        }
    }
494997
protected Document doGet(String spaceId, String key) throws IOException {
        Term termGet = buildIdTerm(spaceId, key);
        IndexSearcher indexSearcher = getIndexSearcher();
        TopDocs result = indexSearcher.search(new TermQuery(termGet), 1);
        ScoreDoc[] hits = result != null ? result.scoreDocs : null;
        Document doc = hits != null && hits.length > 0 ? indexSearcher.doc(hits[0].doc) : null;
        return doc;
    }
593790
@Override
    public int position() {
        // if we are in transferTo mode, then this is the FileChannel position
        if (isFCEnabled()) {
            try {
                return (int) fc.position();
            } catch (IOException e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Exception in position(): " + e);
                }
                FFDCFilter.processException(e, CLASS_NAME + ".position", "656", this);
                throw new RuntimeException(e);
            }
        }
        return super.position();
    }
1161568
public EntryPosition getPosition(Object key, byte[] serializedKey) throws IOException {
      int segment = (key.hashCode() & Integer.MAX_VALUE) % segments.length;
      lock.readLock().lock();
      try {
         return IndexNode.applyOnLeaf(segments[segment], serializedKey, segments[segment].rootReadLock(), IndexNode.ReadOperation.GET_POSITION);
      } finally {
         lock.readLock().unlock();
      }
   }
1206330
public SourcePosition position() {
        return (tree != null)
                ? SourcePositionImpl.make(tree.sourcefile, tree.pos, tree.lineMap)
                : SourcePositionImpl.make(docPath, Position.NOPOS, null);
    }
52669
public Integer getFirstPosition(String key) {
        int position = -1;
        String processedKey = processKey(key);

        if (this.values.containsKey(processedKey) == true) {
            position = this.order.indexOf(processedKey);
        }
        return position;
    }
1290069
@Override
  public int nextDoc() throws IOException {
    resetQueue();
    noMorePositions = false;
    return (spans.nextDoc() == NO_MORE_DOCS) ? NO_MORE_DOCS : toMatchDoc();
  }
151038
private boolean goToNextDoc() throws IOException {
    if (docId == NO_MORE_DOCS) {
      return true;
    } else {
      docId = spans1.spans.nextDoc();
      if (docId == NO_MORE_DOCS) {
        return true;
      } else {
        int spans2DocId = spans2.spans.docID();
        if (spans2DocId < docId) {
          spans2DocId = spans2.spans.advance(docId);
        }
        if (docId != spans2DocId) {
          return spans1.spans.nextStartPosition() != NO_MORE_POSITIONS;
        } else if (goToNextStartPosition()) {
          return true;
        } else {
          reset();
          return false;
        }
      }
    }
  }
1319938
@Override
	// @NotThreadSafe
	public byte get(long position) throws IOException {
		return mappedBuffers.get(getBufferNum(position)).get(getIndex(position));
	}
100967
public Item getItem(int position) {
        if (shouldInsertItemAtPosition(position)) {
            return mItems.get(itemInsertedBeforeCount(position - 1));
        }
        return null;
    }
116619
public IndexDoc getDoc(String field, int docId) {
    if (fieldReferences.containsKey(field)) {
      FieldReferences fr = fieldReferences.get(field);
      try {
        IndexInput inIndexDocId = indexInputList.get("indexDocId");
        ArrayList<MtasTreeHit<?>> list = CodecSearchTree.searchMtasTree(docId,
            inIndexDocId, fr.refIndexDocId, fr.refIndexDoc);
        if (list.size() == 1) {
          return new IndexDoc(list.get(0).ref);
        }
      } catch (IOException e) {
        log.debug(e);
        return null;
      }
    }
    return null;
  }
656026
private static void createPositions(List<ComponentPosition> statsPositionList,
      Map<Integer, Integer> positionsData, List<Integer> docSet)
      throws IOException {
    if (statsPositionList != null) {
      for (ComponentPosition position : statsPositionList) {
        position.dataCollector.initNewList(1);
        Integer tmpValue;
        long[] values = new long[docSet.size()];
        int value;
        int number = 0;
        for (int docId : docSet) {
          tmpValue = positionsData.get(docId);
          value = tmpValue == null ? 0 : tmpValue.intValue();
          if (((position.minimumLong == null)
              || (value >= position.minimumLong))
              && ((position.maximumLong == null)
                  || (value <= position.maximumLong))) {
            values[number] = value;
            number++;
          }
        }
        if (number > 0) {
          position.dataCollector.add(values, number);
        }
        position.dataCollector.closeNewList();
      }
    }
  }
652618
public static int[] getSplit(int docId) {
        if (docId <= 0) {
            throw new IllegalArgumentException("docId must be positive");
        }
        int[] ret = new int[3];
        ret[0] = docId / 1000000;
        ret[1] = (docId % 1000000) / 1000;
        ret[2] = docId % 1000;
        return ret;
    }
1104370
public OvhDocument document_id_GET(String id) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDocument.class);
	}