public class CountTreeBitsCollection extends BitsCollection<TreeMap<Bits,AtomicInteger>>
Modifier and Type | Class and Description |
---|---|
static class |
CountTreeBitsCollection.BranchCounts
The type Branch counts.
|
static class |
CountTreeBitsCollection.SerializationChecks
The enum Serialization checks.
|
BitsCollection.CodeType
Modifier and Type | Field and Description |
---|---|
static boolean |
SERIALIZATION_CHECKS
The constant SERIALIZATION_CHECKS.
|
bitDepth
map
Constructor and Description |
---|
CountTreeBitsCollection()
Instantiates a new Count tree bits collection.
|
CountTreeBitsCollection(BitInputStream bitStream)
Instantiates a new Count tree bits collection.
|
CountTreeBitsCollection(BitInputStream bitStream,
int bitDepth)
Instantiates a new Count tree bits collection.
|
CountTreeBitsCollection(byte[] data)
Instantiates a new Count tree bits collection.
|
CountTreeBitsCollection(byte[] data,
int bitDepth)
Instantiates a new Count tree bits collection.
|
CountTreeBitsCollection(int bitDepth)
Instantiates a new Count tree bits collection.
|
Modifier and Type | Method and Description |
---|---|
TreeMap<Bits,Long> |
computeSums()
Compute sums tree apply.
|
static <T> T |
isNull(T value,
T defaultValue)
Is null t.
|
void |
read(BitInputStream in)
Read.
|
void |
read(BitInputStream in,
int size)
Read.
|
protected CountTreeBitsCollection.BranchCounts |
readBranchCounts(BitInputStream in,
Bits code,
long size)
Read branch counts branch counts.
|
protected long |
readTerminalCount(BitInputStream in,
long size)
Read terminal count long.
|
protected long |
readZeroBranchSize(BitInputStream in,
long max,
Bits code)
Read zero branch size long.
|
CountTreeBitsCollection |
setUseBinomials(boolean useBinomials)
Sets use binomials.
|
long |
sum(Collection<Long> values)
Sum long.
|
byte[] |
toBytes()
To bytes byte [ ].
|
boolean |
useBinomials()
Use binomials boolean.
|
void |
write(BitOutputStream out)
Write.
|
void |
write(BitOutputStream out,
int size)
Write.
|
protected void |
writeBranchCounts(CountTreeBitsCollection.BranchCounts branch,
BitOutputStream out)
Write branch counts.
|
protected void |
writeTerminalCount(BitOutputStream out,
long value,
long max)
Write terminal count.
|
protected void |
writeZeroBranchSize(BitOutputStream out,
long value,
long max,
Bits bits)
Write zero branch size.
|
getType
public static boolean SERIALIZATION_CHECKS
public CountTreeBitsCollection()
public CountTreeBitsCollection(BitInputStream bitStream) throws IOException
bitStream
- the bit streamIOException
- the io exceptionpublic CountTreeBitsCollection(BitInputStream bitStream, int bitDepth) throws IOException
bitStream
- the bit streambitDepth
- the bit depthIOException
- the io exceptionpublic CountTreeBitsCollection(byte[] data) throws IOException
data
- the dataIOException
- the io exceptionpublic CountTreeBitsCollection(byte[] data, int bitDepth) throws IOException
data
- the databitDepth
- the bit depthIOException
- the io exceptionpublic CountTreeBitsCollection(int bitDepth)
bitDepth
- the bit depthpublic static <T> T isNull(T value, T defaultValue)
T
- the type parametervalue
- the valuedefaultValue
- the default valuepublic TreeMap<Bits,Long> computeSums()
public void read(BitInputStream in) throws IOException
BitsCollection
read
in class BitsCollection<TreeMap<Bits,AtomicInteger>>
in
- the inIOException
- the io exceptionpublic void read(BitInputStream in, int size) throws IOException
in
- the insize
- the sizeIOException
- the io exceptionprotected CountTreeBitsCollection.BranchCounts readBranchCounts(BitInputStream in, Bits code, long size) throws IOException
in
- the incode
- the runsize
- the sizeIOException
- the io exceptionprotected long readTerminalCount(BitInputStream in, long size) throws IOException
in
- the insize
- the sizeIOException
- the io exceptionprotected long readZeroBranchSize(BitInputStream in, long max, Bits code) throws IOException
in
- the inmax
- the maxcode
- the runIOException
- the io exceptionpublic CountTreeBitsCollection setUseBinomials(boolean useBinomials)
useBinomials
- the use binomialspublic long sum(Collection<Long> values)
values
- the valuespublic byte[] toBytes() throws IOException
IOException
- the io exceptionpublic boolean useBinomials()
public void write(BitOutputStream out) throws IOException
BitsCollection
write
in class BitsCollection<TreeMap<Bits,AtomicInteger>>
out
- the outIOException
- the io exceptionpublic void write(BitOutputStream out, int size) throws IOException
out
- the outsize
- the sizeIOException
- the io exceptionprotected void writeBranchCounts(CountTreeBitsCollection.BranchCounts branch, BitOutputStream out) throws IOException
branch
- the branchout
- the outIOException
- the io exceptionprotected void writeTerminalCount(BitOutputStream out, long value, long max) throws IOException
out
- the outvalue
- the valuemax
- the maxIOException
- the io exceptionprotected void writeZeroBranchSize(BitOutputStream out, long value, long max, Bits bits) throws IOException
out
- the outvalue
- the valuemax
- the maxbits
- the bitsIOException
- the io exceptionCopyright © 2019 SimiaCryptus Software. All rights reserved.