text: public int nextPosition() throws IOException {if (doc != 0) {throw new IllegalStateException();} else if (i >= termFreq - 1) {throw new IllegalStateException("Read past last position");}++i;if (payloadIndex != null) {payload.offset = basePayloadOffset + payloadIndex[positionIndex + i];payload.length = payloadIndex[positionIndex + i + 1] - payloadIndex[positionIndex + i];}if (positions == null) {return -1;} else {return positions[positionIndex + i];}}