@Test public void test3() throws Exception{ TailIndexBuilder tib = new DenseArrayTailIndexBuilder(); tib.add(0, 0, 10); tib.add(1, -1, -1); tib.add(2, 10, 15); TailIndex ti = tib.build(); Assert.assertEquals(0, ti.get(0)); Assert.assertEquals(-1, ti.get(1)); Assert.assertEquals(10, ti.get(2)); }
@Override public int get(int nodeId) { if(sbv.isZero(nodeId)) return -1; return tail[sbv.rank1(nodeId) - 1]; }
DenseArrayTailIndex implements Externalizable, TailIndex { @Override public int get(int nodeId) { if(sbv.isZero(nodeId)) return -1; return tail[sbv.rank1(nodeId) - 1]; } }
DenseArrayTailIndex implements Externalizable, TailIndex { @Override public int get(int nodeId) { if(sbv.isZero(nodeId)) return -1; return tail[sbv.rank1(nodeId) - 1]; } DenseArrayTailIndex();  DenseArrayTailIndex(int[] tail, byte[] bits, int bitsSize);  DenseArrayTailIndex(SuccinctBitVector sbv, int[] tail); }
DenseArrayTailIndex implements Externalizable, TailIndex { @Override public int get(int nodeId) { if(sbv.isZero(nodeId)) return -1; return tail[sbv.rank1(nodeId) - 1]; } DenseArrayTailIndex();  DenseArrayTailIndex(int[] tail, byte[] bits, int bitsSize);  DenseArrayTailIndex(SuccinctBitVector sbv, int[] tail); SuccinctBitVector getSbv(); void setSbv(SuccinctBitVector sbv); int[] getTail(); void setTail(int[] tail); @Override int size(); @Override int get(int nodeId); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out); }
DenseArrayTailIndex implements Externalizable, TailIndex { @Override public int get(int nodeId) { if(sbv.isZero(nodeId)) return -1; return tail[sbv.rank1(nodeId) - 1]; } DenseArrayTailIndex();  DenseArrayTailIndex(int[] tail, byte[] bits, int bitsSize);  DenseArrayTailIndex(SuccinctBitVector sbv, int[] tail); SuccinctBitVector getSbv(); void setSbv(SuccinctBitVector sbv); int[] getTail(); void setTail(int[] tail); @Override int size(); @Override int get(int nodeId); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out);  }