T
- the type parameterpublic class HammingCode<T extends Comparable<T>> extends Object
Modifier and Type | Class and Description |
---|---|
class |
HammingCode.HammingCodeCollection
The type Hamming run collection.
|
Modifier and Type | Field and Description |
---|---|
protected TreeMap<Bits,T> |
forwardIndex
The Forward index.
|
protected HashMap<T,Bits> |
reverseIndex
The Reverse index.
|
protected long |
totalWeight
The Total weight.
|
protected HashMap<T,Integer> |
weights
The Weights.
|
Constructor and Description |
---|
HammingCode(Collection<HammingSymbol<T>> symbols)
Instantiates a new Hamming run.
|
Modifier and Type | Method and Description |
---|---|
int |
codeSize()
Code size int.
|
T |
decode(BitInputStream in)
Decode t.
|
Map.Entry<Bits,T> |
decode(Bits data)
Decode entry.
|
Bits |
encode(T key)
Encode bits.
|
SortedMap<Bits,T> |
getCodes(Bits fromKey)
Gets codes.
|
CountTreeBitsCollection |
getSetEncoder()
Gets set encoder.
|
CountTreeBitsCollection |
getSetEncoder(BitInputStream data)
Gets set encoder.
|
CountTreeBitsCollection |
getSetEncoder(byte[] data)
Gets set encoder.
|
Map<T,Integer> |
getWeights()
Gets weights.
|
static boolean |
isPrefixFreeCode(Set<Bits> keySet)
Is prefix free run boolean.
|
int |
totalWeight()
Total weight int.
|
boolean |
verifyIndexes()
Verify indexes boolean.
|
protected final TreeMap<Bits,T extends Comparable<T>> forwardIndex
protected final HashMap<T extends Comparable<T>,Bits> reverseIndex
protected final HashMap<T extends Comparable<T>,Integer> weights
protected final long totalWeight
public HammingCode(Collection<HammingSymbol<T>> symbols)
symbols
- the symbolspublic static boolean isPrefixFreeCode(Set<Bits> keySet)
keySet
- the key setpublic int codeSize()
public T decode(BitInputStream in) throws IOException
in
- the inIOException
- the io exceptionpublic Map.Entry<Bits,T> decode(Bits data)
data
- the datapublic SortedMap<Bits,T> getCodes(Bits fromKey)
fromKey
- the from keypublic CountTreeBitsCollection getSetEncoder()
public CountTreeBitsCollection getSetEncoder(BitInputStream data) throws IOException
data
- the dataIOException
- the io exceptionpublic CountTreeBitsCollection getSetEncoder(byte[] data) throws IOException
data
- the dataIOException
- the io exceptionpublic boolean verifyIndexes()
public int totalWeight()
Copyright © 2019 SimiaCryptus Software. All rights reserved.