Search in sources :

Example 1 with LongsSuccinctBitVector

use of org.trie4j.bv.LongsSuccinctBitVector 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)

Example 2 with LongsSuccinctBitVector

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

the class LongsTailLOUDSPPTrieWithSuffixTrieDenseTailArrayWikipediaSerializeTest method secondTrie.

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

Aggregations

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