/** * Thread-local object for constructing keys for the lexicon. */ public LexiconKeyBuilder getLexiconKeyBuilder() { /* * FIXME We should save off a reference to this to reduce heap churn * and then use that reference in this class. */ return new LexiconKeyBuilder(getKeyBuilder()); }
@Override protected void addValues() { addDecl(new MyVocabularyDecl()); } }
/** * Unit test with ONE (1) for pid and local counter. */ public void test_encode_decode_1bits_pid1_ctr1() { doEncodeDecodeTest(new TermIdEncoder(1), 1/* pid */, 1/* ctr */); }
/** * Return the unsigned byte[] key for an RDF {@link Value}. * * @param obj * The RDF {@link Value}. */ @Override public byte[] serializeKey(Object obj) { return getLexiconKeyBuilder().value2Key((Value)obj); }
/** * Unit test with {@link Integer#MIN_VALUE} for pid and 0L for the local * counter (this combination should not occur in practice since we increment * the local counter before assigning the term identifier rather than after). */ public void test_encode_decode_1bits_pidMIN_ctr0() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, 0/* ctr */); }
/** * Thread-local object for constructing keys for the lexicon. */ public LexiconKeyBuilder getLexiconKeyBuilder() { /* * FIXME We should save off a reference to this to reduce heap churn * and then use that reference in this class. */ return new LexiconKeyBuilder(getKeyBuilder()); }
@Override protected void addValues() { addDecl(new MyVocabularyDecl()); } }
/** * Test of encode/decode when ZERO (0) of the low bits are reversed and * placed into the high bits. The encoding should be a NOP in this special * case. */ public void test_encode_decode_0bits_pid1_ctr1() { final TermIdEncoder encoder = new TermIdEncoder(0); final int pid = 1; final int ctr = 1; doEncodeDecodeTest(encoder, pid, ctr); }
/** * Unit test with {@link Integer#MIN_VALUE} for the pid and * {@link Integer#MAX_VALUE} for the local counter. */ public void test_encode_decode_1bits_pidMIN_ctrMAX() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, Integer.MAX_VALUE/* ctr */); }
/** * Unit test with {@link Integer#MAX_VALUE} for the pid and * {@link Integer#MIN_VALUE} for the local counter. */ public void test_encode_decode_1bits_pidMAX_ctrMIN() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MAX_VALUE/* pid */, Integer.MIN_VALUE/* ctr */); }
/** * Test of encode/decode when ZERO (0) of the low bits are reversed and * placed into the high bits. The encoding should be a NOP in this special * case. */ public void test_encode_decode_0bits_pid1_ctr1() { final TermIdEncoder encoder = new TermIdEncoder(0); final int pid = 1; final int ctr = 1; doEncodeDecodeTest(encoder, pid, ctr); }
/** * Unit test with {@link Integer#MAX_VALUE} for pid and local counter. */ public void test_encode_decode_1bits_pidMAX_ctrMAX() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MAX_VALUE/* pid */, Integer.MAX_VALUE/* ctr */); }
/** * Unit test with {@link Integer#MIN_VALUE} for pid and local counter. */ public void test_encode_decode_1bits_pidMIN_ctrMIN() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, Integer.MIN_VALUE/* ctr */); }
/** * Unit test with ONE (1) for pid and local counter. */ public void test_encode_decode_1bits_pid1_ctr1() { doEncodeDecodeTest(new TermIdEncoder(1), 1/* pid */, 1/* ctr */); }
/** * Unit test with {@link Integer#MAX_VALUE} for pid and local counter. */ public void test_encode_decode_1bits_pidMAX_ctrMAX() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MAX_VALUE/* pid */, Integer.MAX_VALUE/* ctr */); }
/** * Unit test with {@link Integer#MIN_VALUE} for pid and 0L for the local * counter (this combination should not occur in practice since we increment * the local counter before assigning the term identifier rather than after). */ public void test_encode_decode_1bits_pidMIN_ctr0() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, 0/* ctr */); }
/** * Unit test with {@link Integer#MIN_VALUE} for the pid and * {@link Integer#MAX_VALUE} for the local counter. */ public void test_encode_decode_1bits_pidMIN_ctrMAX() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, Integer.MAX_VALUE/* ctr */); }
/** * Unit test with {@link Integer#MAX_VALUE} for the pid and * {@link Integer#MIN_VALUE} for the local counter. */ public void test_encode_decode_1bits_pidMAX_ctrMIN() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MAX_VALUE/* pid */, Integer.MIN_VALUE/* ctr */); }
/** * Test of encode/decode when ZERO (0) of the low bits are reversed and * placed into the high bits. The encoding should be a NOP in this special * case. */ public void test_encode_decode_0bits_pid1_ctr1() { final TermIdEncoder encoder = new TermIdEncoder(0); final int pid = 1; final int ctr = 1; doEncodeDecodeTest(encoder, pid, ctr); }
/** * Unit test with {@link Integer#MIN_VALUE} for pid and local counter. */ public void test_encode_decode_1bits_pidMIN_ctrMIN() { doEncodeDecodeTest(new TermIdEncoder(1), Integer.MIN_VALUE/* pid */, Integer.MIN_VALUE/* ctr */); }