本文整理匯總了Java中org.apache.lucene.index.RandomCodec類的典型用法代碼示例。如果您正苦於以下問題:Java RandomCodec類的具體用法?Java RandomCodec怎麽用?Java RandomCodec使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RandomCodec類屬於org.apache.lucene.index包,在下文中一共展示了RandomCodec類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkCodecRestrictions
import org.apache.lucene.index.RandomCodec; //導入依賴的package包/類
/**
* Check codec restrictions.
*
* @throws AssumptionViolatedException if the class does not work with a given codec.
*/
private void checkCodecRestrictions(Codec codec) {
assumeFalse("Class not allowed to use codec: " + codec.getName() + ".",
shouldAvoidCodec(codec.getName()));
if (codec instanceof RandomCodec && !avoidCodecs.isEmpty()) {
for (String name : ((RandomCodec)codec).formatNames) {
assumeFalse("Class not allowed to use postings format: " + name + ".",
shouldAvoidCodec(name));
}
}
PostingsFormat pf = codec.postingsFormat();
assumeFalse("Class not allowed to use postings format: " + pf.getName() + ".",
shouldAvoidCodec(pf.getName()));
assumeFalse("Class not allowed to use postings format: " + LuceneTestCase.TEST_POSTINGSFORMAT + ".",
shouldAvoidCodec(LuceneTestCase.TEST_POSTINGSFORMAT));
}
示例2: setUp
import org.apache.lucene.index.RandomCodec; //導入依賴的package包/類
@Override
public void setUp() throws Exception {
codec = new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet());
super.setUp();
}
示例3: getCodec
import org.apache.lucene.index.RandomCodec; //導入依賴的package包/類
@Override
protected Codec getCodec() {
return new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet());
}
示例4: setUp
import org.apache.lucene.index.RandomCodec; //導入依賴的package包/類
@Override
public void setUp() throws Exception {
super.setUp();
codec = new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet());
}