public final boolean incrementToken() throws IOException { if (input.incrementToken()) { int len = termAtt.termLength(); len++; termAtt.resizeTermBuffer(len); termAtt.termBuffer()[len - 1] = WILDCARD_OPERATOR; termAtt.setTermLength(len); return true; } else { return false; } }
@Override public boolean incrementToken() { if (this.i >= this.segments.size()) { return false; } clearAttributes(); IntervalSegment interval = this.segments.get(this.i); long value = interval.getStart(); int shift = interval.getShift(); final char[] buffer = this.termAtt.resizeTermBuffer(NumericUtils.BUF_SIZE_LONG); this.termAtt.setTermLength( NumericUtils.longToPrefixCoded(value, shift, buffer)); this.i++; return true; }
@Override public boolean incrementToken() throws IOException { if (input.incrementToken()) { char[] termBuffer = termAtt.termBuffer(); String termText = new String(termBuffer, 0, termAtt.termLength()); collator.getRawCollationKey(termText, reusableKey); ByteBuffer collationKeyBuf = ByteBuffer.wrap(reusableKey.bytes, 0, reusableKey.size); int encodedLength = IndexableBinaryStringTools.getEncodedLength(collationKeyBuf); if (encodedLength > termBuffer.length) { termAtt.resizeTermBuffer(encodedLength); } termAtt.setTermLength(encodedLength); CharBuffer wrappedTermBuffer = CharBuffer.wrap(termAtt.termBuffer()); IndexableBinaryStringTools.encode(collationKeyBuf, wrappedTermBuffer); return true; } else { return false; } } }
@Override public boolean incrementToken() throws IOException { if (input.incrementToken()) { char[] termBuffer = termAtt.termBuffer(); String termText = new String(termBuffer, 0, termAtt.termLength()); byte[] collationKey = collator.getCollationKey(termText).toByteArray(); ByteBuffer collationKeyBuf = ByteBuffer.wrap(collationKey); int encodedLength = IndexableBinaryStringTools.getEncodedLength(collationKeyBuf); if (encodedLength > termBuffer.length) { termAtt.resizeTermBuffer(encodedLength); } termAtt.setTermLength(encodedLength); CharBuffer wrappedTermBuffer = CharBuffer.wrap(termAtt.termBuffer()); IndexableBinaryStringTools.encode(collationKeyBuf, wrappedTermBuffer); return true; } else { return false; } } }
termAtt.setTermBuffer(termBuffer, start, (end - start)); } else { termAtt.setTermLength(0);