本文整理汇总了Java中org.apache.lucene.util.LongsRef类的典型用法代码示例。如果您正苦于以下问题:Java LongsRef类的具体用法?Java LongsRef怎么用?Java LongsRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LongsRef类属于org.apache.lucene.util包,在下文中一共展示了LongsRef类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: next
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
/** Read between <tt>1</tt> and <code>count</code> values. */
public LongsRef next(int count) throws IOException {
assert count > 0;
if (ord == valueCount) {
throw new EOFException();
}
if (off == blockSize) {
refill();
}
count = Math.min(count, blockSize - off);
count = (int) Math.min(count, valueCount - ord);
valuesRef.offset = off;
valuesRef.length = count;
off += count;
ord += count;
return valuesRef;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:BlockPackedReaderIterator.java
示例2: BlockPackedReaderIterator
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
/** Sole constructor.
* @param blockSize the number of values of a block, must be equal to the
* block size of the {@link BlockPackedWriter} which has
* been used to write the stream
*/
public BlockPackedReaderIterator(DataInput in, int packedIntsVersion, int blockSize, long valueCount) {
checkBlockSize(blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE);
this.packedIntsVersion = packedIntsVersion;
this.blockSize = blockSize;
this.values = new long[blockSize];
this.valuesRef = new LongsRef(this.values, 0, 0);
reset(in, valueCount);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:BlockPackedReaderIterator.java
示例3: next
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
@Override
public LongsRef next(int count) throws IOException {
assert nextValues.length >= 0;
assert count > 0;
assert nextValues.offset + nextValues.length <= nextValues.longs.length;
nextValues.offset += nextValues.length;
final int remaining = valueCount - position - 1;
if (remaining <= 0) {
throw new EOFException();
}
count = Math.min(remaining, count);
if (nextValues.offset == nextValues.longs.length) {
final long remainingBlocks = format.byteCount(packedIntsVersion, remaining, bitsPerValue);
final int blocksToRead = (int) Math.min(remainingBlocks, nextBlocks.length);
in.readBytes(nextBlocks, 0, blocksToRead);
if (blocksToRead < nextBlocks.length) {
Arrays.fill(nextBlocks, blocksToRead, nextBlocks.length, (byte) 0);
}
bulkOperation.decode(nextBlocks, 0, nextValues.longs, 0, iterations);
nextValues.offset = 0;
}
nextValues.length = Math.min(nextValues.longs.length - nextValues.offset, count);
position += nextValues.length;
return nextValues;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:PackedReaderIterator.java
示例4: OrdinalsBuilder
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
public OrdinalsBuilder(long numTerms, int maxDoc, float acceptableOverheadRatio) throws IOException {
this.maxDoc = maxDoc;
int startBitsPerValue = 8;
if (numTerms >= 0) {
startBitsPerValue = PackedInts.bitsRequired(numTerms);
}
ordinals = new OrdinalsStore(maxDoc, startBitsPerValue, acceptableOverheadRatio);
spare = new LongsRef();
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:OrdinalsBuilder.java
示例5: BlockPackedReaderIterator
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
/** Sole constructor.
* @param blockSize the number of values of a block, must be equal to the
* block size of the {@link BlockPackedWriter} which has
* been used to write the stream
*/
public BlockPackedReaderIterator(DataInput in, int packedIntsVersion, int blockSize, long valueCount) {
checkBlockSize(blockSize);
this.packedIntsVersion = packedIntsVersion;
this.blockSize = blockSize;
this.values = new long[blockSize];
this.valuesRef = new LongsRef(this.values, 0, 0);
reset(in, valueCount);
}
开发者ID:pkarmstr,项目名称:NYBC,代码行数:14,代码来源:BlockPackedReaderIterator.java
示例6: OrdinalsBuilder
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
public OrdinalsBuilder(int maxDoc, float acceptableOverheadRatio) throws IOException {
this.maxDoc = maxDoc;
int startBitsPerValue = 8;
ordinals = new OrdinalsStore(maxDoc, startBitsPerValue, acceptableOverheadRatio);
spare = new LongsRef();
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:OrdinalsBuilder.java
示例7: docOrds
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
/**
* Returns a shared {@link LongsRef} instance for the given doc ID holding all ordinals associated with it.
*/
public LongsRef docOrds(int docID) {
spare.offset = spare.length = 0;
ordinals.appendOrdinals(docID, spare);
return spare;
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:OrdinalsBuilder.java
示例8: next
import org.apache.lucene.util.LongsRef; //导入依赖的package包/类
/** Returns at least 1 and at most <code>count</code> next values,
* the returned ref MUST NOT be modified */
LongsRef next(int count) throws IOException;
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:PackedInts.java
注:本文中的org.apache.lucene.util.LongsRef类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论