Completed implementation of interleaver. Needs testing!

This commit is contained in:
Sascha L. Teichmann
2014-08-21 14:46:34 +02:00
parent cfb6edcd29
commit b393712801
5 changed files with 158 additions and 12 deletions

View File

@ -143,3 +143,31 @@ func TransformPlainToInterleaved(pos int64) int64 {
func TransformInterleavedPlain(pos int64) int64 {
return CoordToPlain(InterleavedToCoord(pos))
}
func SelectKeySplitter(interleaved bool) KeySplitter {
if interleaved {
return InterleavedToCoord
}
return PlainToCoord
}
func SelectKeyJoiner(interleaved bool) KeyJoiner {
if interleaved {
return CoordToInterleaved
}
return CoordToPlain
}
func SelectKeyDecoder(interleaved bool) KeyDecoder {
if interleaved {
return DecodeFromBigEndian
}
return DecodeStringFromBytes
}
func SelectKeyEncoder(interleaved bool) KeyEncoder {
if interleaved {
return EncodeToBigEndian
}
return EncodeStringToBytes
}