Search in sources :

Example 1 with BytesRank0OnlySuccinctBitVector

use of org.trie4j.bv.BytesRank0OnlySuccinctBitVector in project trie4j by takawitter.

the class BytesConstantTimeSelect0TailLOUDSPPTrieWithSuffixTrieDenseTailArrayWikipediaSerializeTest method secondTrie.

@Override
protected Trie secondTrie(Trie firstTrie) {
    Trie t = new TailLOUDSTrie(firstTrie, new LOUDSPPBvTree(new BytesRank0OnlySuccinctBitVector(), new BytesConstantTimeSelect0SuccinctBitVector()), new SuffixTrieDenseTailArrayBuilder());
    t.trimToSize();
    return t;
}
Also used : LOUDSPPBvTree(org.trie4j.louds.bvtree.LOUDSPPBvTree) BytesRank0OnlySuccinctBitVector(org.trie4j.bv.BytesRank0OnlySuccinctBitVector) SuffixTrieDenseTailArrayBuilder(org.trie4j.tail.SuffixTrieDenseTailArrayBuilder) BytesConstantTimeSelect0SuccinctBitVector(org.trie4j.bv.BytesConstantTimeSelect0SuccinctBitVector) Trie(org.trie4j.Trie)

Example 2 with BytesRank0OnlySuccinctBitVector

use of org.trie4j.bv.BytesRank0OnlySuccinctBitVector in project trie4j by takawitter.

the class TrieWriter method writeSuccinctBitVector.

public void writeSuccinctBitVector(SuccinctBitVector sbv) throws IOException {
    if (sbv instanceof BytesSuccinctBitVector) {
        dos.writeShort(TYPE_SBV_BYTES);
        writeBytesSuccinctBitVector((BytesSuccinctBitVector) sbv);
    } else if (sbv instanceof BytesRank0OnlySuccinctBitVector) {
        dos.writeShort(TYPE_SBV_RANK0ONLY);
        writeRank0OnlySuccinctBitVector((BytesRank0OnlySuccinctBitVector) sbv);
    } else if (sbv instanceof BytesRank1OnlySuccinctBitVector) {
        dos.writeShort(TYPE_SBV_RANK1ONLY);
        writeRank1OnlySuccinctBitVector((BytesRank1OnlySuccinctBitVector) sbv);
    } else if (sbv instanceof BytesRank1OnlySuccinctBitVector) {
        dos.writeShort(TYPE_SBV_LONGS);
        writeLongsSuccinctBitVector((LongsSuccinctBitVector) sbv);
    } else {
        throw new IOException("unknown sbv: " + sbv.getClass().getName());
    }
}
Also used : BytesRank0OnlySuccinctBitVector(org.trie4j.bv.BytesRank0OnlySuccinctBitVector) BytesSuccinctBitVector(org.trie4j.bv.BytesSuccinctBitVector) BytesRank1OnlySuccinctBitVector(org.trie4j.bv.BytesRank1OnlySuccinctBitVector) IOException(java.io.IOException) LongsSuccinctBitVector(org.trie4j.bv.LongsSuccinctBitVector)

Aggregations

BytesRank0OnlySuccinctBitVector (org.trie4j.bv.BytesRank0OnlySuccinctBitVector)2 IOException (java.io.IOException)1 Trie (org.trie4j.Trie)1 BytesConstantTimeSelect0SuccinctBitVector (org.trie4j.bv.BytesConstantTimeSelect0SuccinctBitVector)1 BytesRank1OnlySuccinctBitVector (org.trie4j.bv.BytesRank1OnlySuccinctBitVector)1 BytesSuccinctBitVector (org.trie4j.bv.BytesSuccinctBitVector)1 LongsSuccinctBitVector (org.trie4j.bv.LongsSuccinctBitVector)1 LOUDSPPBvTree (org.trie4j.louds.bvtree.LOUDSPPBvTree)1 SuffixTrieDenseTailArrayBuilder (org.trie4j.tail.SuffixTrieDenseTailArrayBuilder)1