@Override public BytesRef next() { ord++; if (ord >= numTerms) { return null; } else { int textStart = postingsArray.textStarts[sortedTermIDs[ord]]; terms.bytePool.setBytesRef(scratch, textStart); return scratch; } }
@Override protected BytesRef get(int i) { pool.setBytesRef(scratch, bytesStart[compact[i]]); return scratch; }
public void seekExact(long ord) { this.ord = (int) ord; int textStart = postingsArray.textStarts[sortedTermIDs[this.ord]]; terms.bytePool.setBytesRef(scratch, textStart); }
/** * Populates and returns a {@link BytesRef} with the bytes for the given * bytesID. * <p> * Note: the given bytesID must be a positive integer less than the current * size ({@link #size()}) * * @param bytesID * the id * @param ref * the {@link BytesRef} to populate * * @return the given BytesRef instance populated with the bytes for the given * bytesID */ public BytesRef get(int bytesID, BytesRef ref) { assert bytesStart != null : "bytesStart is null - not initialized"; assert bytesID < bytesStart.length: "bytesID exceeds byteStart len: " + bytesStart.length; pool.setBytesRef(ref, bytesStart[bytesID]); return ref; }
private boolean equals(int id, BytesRef b) { pool.setBytesRef(scratch1, bytesStart[id]); return scratch1.bytesEquals(b); }
/** 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); }
int mid = (lo + hi) >>> 1; int textStart = postingsArray.textStarts[sortedTermIDs[mid]]; terms.bytePool.setBytesRef(scratch, textStart); int cmp = scratch.compareTo(text); if (cmp < 0) { } else { int textStart = postingsArray.textStarts[sortedTermIDs[ord]]; terms.bytePool.setBytesRef(scratch, textStart); assert term().compareTo(text) > 0; return SeekStatus.NOT_FOUND;
termBytePool.setBytesRef(flushTerm, postings.textStarts[termID]); tv.startTerm(flushTerm, freq);
@Override public BytesRef next() { ord++; if (ord >= numTerms) { return null; } else { int textStart = postingsArray.textStarts[sortedTermIDs[ord]]; terms.bytePool.setBytesRef(scratch, textStart); return scratch; } }
@Override protected void setPivot(int i) { final int id = compact[i]; assert bytesStart.length > id; pool.setBytesRef(pivot, bytesStart[id]); }
@Override protected void setPivot(int i) { final int id = compact[i]; assert bytesStart.length > id; pool.setBytesRef(pivot, bytesStart[id]); }
public void seekExact(long ord) { this.ord = (int) ord; int textStart = postingsArray.textStarts[sortedTermIDs[this.ord]]; terms.bytePool.setBytesRef(scratch, textStart); }
@Override protected BytesRef get(int i) { pool.setBytesRef(scratch, bytesStart[compact[i]]); return scratch; }
public void seekExact(long ord) { this.ord = (int) ord; int textStart = postingsArray.textStarts[sortedTermIDs[this.ord]]; terms.bytePool.setBytesRef(scratch, textStart); }
@Override public BytesRef next() { ord++; if (ord >= numTerms) { return null; } else { int textStart = postingsArray.textStarts[sortedTermIDs[ord]]; terms.bytePool.setBytesRef(scratch, textStart); return scratch; } }
@Override public BytesRef next() { ord++; if (ord >= numTerms) { return null; } else { int textStart = postingsArray.textStarts[sortedTermIDs[ord]]; terms.bytePool.setBytesRef(scratch, textStart); return scratch; } }
@Override protected int compare(int i, int j) { final int id1 = compact[i], id2 = compact[j]; assert bytesStart.length > id1 && bytesStart.length > id2; pool.setBytesRef(scratch1, bytesStart[id1]); pool.setBytesRef(scratch2, bytesStart[id2]); return comp.compare(scratch1, scratch2); }
@Override protected int compare(int i, int j) { final int id1 = compact[i], id2 = compact[j]; assert bytesStart.length > id1 && bytesStart.length > id2; pool.setBytesRef(scratch1, bytesStart[id1]); pool.setBytesRef(scratch2, bytesStart[id2]); return comp.compare(scratch1, scratch2); }
@Override protected int comparePivot(int j) { final int id = compact[j]; assert bytesStart.length > id; pool.setBytesRef(scratch2, bytesStart[id]); return comp.compare(pivot, scratch2); }
@Override protected int comparePivot(int j) { final int id = compact[j]; assert bytesStart.length > id; pool.setBytesRef(scratch2, bytesStart[id]); return comp.compare(pivot, scratch2); }