@Override public final char charAt(int index) { FutureObjects.checkIndex(index, termLength); return termBuffer[index]; }
@Override public char charAt(int index) { // NOTE: must do a real check here to meet the specs of CharSequence FutureObjects.checkIndex(index, length); return chars[offset + index]; }
@Override public boolean get(int doc) { FutureObjects.checkIndex(doc, length); return parent.get(doc+start); }
/** Set or clear this state as an accept state. */ public void setAccept(int state, boolean accept) { FutureObjects.checkIndex(state, getNumStates()); this.isAccept.set(state, accept); }
/** Set or clear this state as an accept state. */ public void setAccept(int state, boolean accept) { FutureObjects.checkIndex(state, getNumStates()); isAccept.set(state, accept); }
/** Used only by sort below, to set a {@link BytesRef} with the specified slice, avoiding copying bytes in the common case when the slice * is contained in a single block in the byte block pool. */ private void setBytesRef(BytesRefBuilder spare, BytesRef result, int index) { FutureObjects.checkIndex(index, lastElement); int offset = offsets[index]; int length; if (index == lastElement - 1) { length = currentOffset - offset; } else { length = offsets[index + 1] - offset; } pool.setBytesRef(spare, result, offset, length); }
private void checkBounds(int docID) { FutureObjects.checkIndex(docID, maxDoc()); }
private void checkBounds(int docID) { FutureObjects.checkIndex(docID, maxDoc()); }
/** Add a new transition with the specified source, dest, min, max. */ public void addTransition(int source, int dest, int min, int max) { assert nextTransition%3 == 0; int bounds = nextState/2; FutureObjects.checkIndex(source, bounds); FutureObjects.checkIndex(dest, bounds); growTransitions(); if (curState != source) { if (curState != -1) { finishCurrentState(); } // Move to next source: curState = source; if (states[2*curState] != -1) { throw new IllegalStateException("from state (" + source + ") already had transitions added"); } assert states[2*curState+1] == 0; states[2*curState] = nextTransition; } transitions[nextTransition++] = dest; transitions[nextTransition++] = min; transitions[nextTransition++] = max; // Increment transition count for this state states[2*curState+1]++; }
/** * Get the min value for the given dimension * @param dimension the dimension, always positive * @return the decoded min value */ public double getMin(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMin(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the min value for the given dimension * @param dimension the dimension, always positive * @return the decoded min value */ public long getMin(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMin(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the max value for the given dimension * @param dimension the dimension, always positive * @return the decoded max value */ public float getMax(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMax(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the max value for the given dimension * @param dimension the dimension, always positive * @return the decoded max value */ public double getMax(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMax(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the max value for the given dimension * @param dimension the dimension, always positive * @return the decoded max value */ public long getMax(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMax(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the min value for the given dimension * @param dimension the dimension, always positive * @return the decoded min value */ public int getMin(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMin(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the max value for the given dimension * @param dimension the dimension, always positive * @return the decoded max value */ public int getMax(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMax(((BytesRef)fieldsData).bytes, dimension); }
/** * Get the min value for the given dimension * @param dimension the dimension, always positive * @return the decoded min value */ public float getMin(int dimension) { FutureObjects.checkIndex(dimension, type.pointDataDimensionCount()/2); return decodeMin(((BytesRef)fieldsData).bytes, dimension); }
public BulkScorerAndDoc get(int i) { FutureObjects.checkIndex(i, size()); return (BulkScorerAndDoc) getHeapArray()[1 + i]; }
/** * Returns the <i>n'th</i> element of this {@link BytesRefArray} * @param spare a spare {@link BytesRef} instance * @param index the elements index to retrieve * @return the <i>n'th</i> element of this {@link BytesRefArray} */ public BytesRef get(BytesRefBuilder spare, int index) { FutureObjects.checkIndex(index, lastElement); int offset = offsets[index]; int length = index == lastElement - 1 ? currentOffset - offset : offsets[index + 1] - offset; spare.grow(length); spare.setLength(length); pool.readBytes(offset, spare.bytes(), 0, spare.length()); return spare.get(); }
/** Set or clear this state as an accept state. */ public void setAccept(int state, boolean accept) { FutureObjects.checkIndex(state, getNumStates()); this.isAccept.set(state, accept); }