|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.raba.codec.AbstractCodedRaba
com.bigdata.btree.raba.codec.CanonicalHuffmanRabaCoder.CodedRabaImpl
public static class CanonicalHuffmanRabaCoder.CodedRabaImpl
Decoder.
| Constructor Summary | |
|---|---|
CanonicalHuffmanRabaCoder.CodedRabaImpl(AbstractFixedByteArrayBuffer data)
Constructor used to decode a data record. |
|
CanonicalHuffmanRabaCoder.CodedRabaImpl(AbstractFixedByteArrayBuffer data,
it.unimi.dsi.compression.Decoder decoder,
long decoderInputsBitLength)
Constructor used when encoding a data record (more information is available from the caller's context). |
|
| Method Summary | |
|---|---|
int |
capacity()
The capacity is equal to the size (the data are immutable). |
int |
copy(int index,
OutputStream os)
This decodes the value at the specified index in a single pass onto the caller's stream. |
AbstractFixedByteArrayBuffer |
data()
The coded (aka compressed) data. |
byte[] |
get(int index)
This uses two passes over the code words for the given index. |
boolean |
isEmpty()
True iff the logical byte[][] is empty. |
boolean |
isFull()
Always returns true since size() ==
capacity() by definition for this class. |
boolean |
isKeys()
When true the IRaba supports search and elements are
interpreted as unsigned byte[]s (B+Tree keys). |
boolean |
isNull(int index)
Return true iff the byte[] at that index is
null. |
Iterator<byte[]> |
iterator()
Basic implementation may be overridden if a faster implementation is available. |
int |
length(int index)
This computes the length of the decoded byte[] by counting the code words for the coded value. |
int |
search(byte[] probe)
This is an efficient binary search performed without materializing the coded byte[][]. |
int |
size()
The #of entries in the logical byte[][]. |
| Methods inherited from class com.bigdata.btree.raba.codec.AbstractCodedRaba |
|---|
add, add, add, isReadOnly, set, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CanonicalHuffmanRabaCoder.CodedRabaImpl(AbstractFixedByteArrayBuffer data)
data - The record containing the coded data.
public CanonicalHuffmanRabaCoder.CodedRabaImpl(AbstractFixedByteArrayBuffer data,
it.unimi.dsi.compression.Decoder decoder,
long decoderInputsBitLength)
data - The record containing the coded data.decoder - The decoder (optional). When not given the decoder is
reconstructed from the record.decoderInputsBitLength - The bit length of the HuffmanCodec.DecoderInputs in the coded
data record. This information is used to skip beyond the
HuffmanCodec.DecoderInputs without having to read them from the
InputBitStream.| Method Detail |
|---|
public final int size()
IRaba
public final int capacity()
public final boolean isEmpty()
IRaba
public final boolean isFull()
true since size() ==
capacity() by definition for this class.
public final boolean isKeys()
IRabatrue the IRaba supports search and elements are
interpreted as unsigned byte[]s (B+Tree keys). For this case
the application MUST ensure that the elements are maintained in
unsigned byte[] order and that duplicates byte[]s are not
stored.
When false, the IRaba allows nulls and
the elements are interpreted as signed byte[] (B+Tree
values).
true if the IRaba represents B+Tree keys and
false if it represents B+Tree values.public AbstractFixedByteArrayBuffer data()
ICodedRaba
public boolean isNull(int index)
IRabatrue iff the byte[] at that index is
null. If IRaba.isKeys() would return
true then this method MUST return false since
nulls are not permitted for B+Tree keys.
index - The index in [0:IRaba.size()-1].public int length(int index)
index - The index in [0:IRaba.size()-1].
public byte[] get(int index)
index - The index in [0:IRaba.size()-1].
null if a
null value was stored at that index.
public int copy(int index,
OutputStream os)
index - The index in [0:IRaba.size()-1].
public Iterator<byte[]> iterator()
iterator in interface IRabaiterator in interface Iterable<byte[]>iterator in class AbstractCodedRabapublic int search(byte[] probe)
probe - The search key.
(-(insertion point) - 1). The insertion point is
defined as the point at which the key would be inserted. Note
that this guarantees that the return value will be >= 0 if and
only if the key is found.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||