- All Superinterfaces:
org.refcodes.mixin.CharSetAccessor,org.refcodes.numerical.NumberBaseAccessor,org.refcodes.numerical.PaddingCharAccessor
- All Known Implementing Classes:
BaseMetricsConfig,BaseMetricsImpl
public interface BaseMetrics
extends org.refcodes.mixin.CharSetAccessor, org.refcodes.numerical.PaddingCharAccessor, org.refcodes.numerical.NumberBaseAccessor
The
BaseMetrics provide the metrics for a codec to be used by an
implementation of the BaseBuilder, the BaseDecoder, the
BaseEncoder or the like.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.CharSetAccessor
org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B extends org.refcodes.mixin.CharSetAccessor.CharSetBuilder<B>>, org.refcodes.mixin.CharSetAccessor.CharSetMutator, org.refcodes.mixin.CharSetAccessor.CharSetPropertyNested classes/interfaces inherited from interface org.refcodes.numerical.NumberBaseAccessor
org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B extends org.refcodes.numerical.NumberBaseAccessor.NumberBaseBuilder<B>>, org.refcodes.numerical.NumberBaseAccessor.NumberBaseMutator, org.refcodes.numerical.NumberBaseAccessor.NumberBasePropertyNested classes/interfaces inherited from interface org.refcodes.numerical.PaddingCharAccessor
org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B extends org.refcodes.numerical.PaddingCharAccessor.PaddingCharBuilder<B>>, org.refcodes.numerical.PaddingCharAccessor.PaddingCharMutator, org.refcodes.numerical.PaddingCharAccessor.PaddingCharProperty -
Method Summary
Modifier and TypeMethodDescriptionintNumber in bits for one digit.intNumber of bytes to exactly fit into an encoded block.intNumber of bytes to exactly store a minimum number of digits.char[]intThe digit mask is the bit-field covering just the digit's bits (starting at bit 0).default intThe size of a digits-block, anyStringof digits not being a multiple of the digits-block size requires padding chars.intNumber of digits required to represent a byte.intNumber of digits stored in an integer.chartoChar(int aValue) Retrieves the (encoded) character for the (decoded) value.default StringtoPaddingChars(int aSize) Determines the paddingStringto be appended to data of the given number of bytes to be encoded.default inttoPaddingCharsNumber(int aSize) Determines the number of padding characters to be appended to data of a given number of bytes to be encoded.inttoValue(char aChar) Retrieves the (decoded) value for the (encoded) character.Methods inherited from interface org.refcodes.numerical.NumberBaseAccessor
getNumberBaseMethods inherited from interface org.refcodes.numerical.PaddingCharAccessor
getPaddingChar
-
Method Details
-
getCharSet
char[] getCharSet()- Specified by:
getCharSetin interfaceorg.refcodes.mixin.CharSetAccessor
-
getBytesPerInt
int getBytesPerInt()Number of bytes to exactly store a minimum number of digits.- Returns:
- the bytes per int
-
getBytesPerBlock
int getBytesPerBlock()Number of bytes to exactly fit into an encoded block.- Returns:
- the bytes per block
-
getDigitsPerInt
int getDigitsPerInt()Number of digits stored in an integer.- Returns:
- the digits per int
-
getDigitsPerBlock
default int getDigitsPerBlock()The size of a digits-block, anyStringof digits not being a multiple of the digits-block size requires padding chars.- Returns:
- the digits per block.
-
getBitsPerDigit
int getBitsPerDigit()Number in bits for one digit.- Returns:
- the bits per digit
-
getDigitsPerByte
int getDigitsPerByte()Number of digits required to represent a byte.- Returns:
- the digits per byte
-
getDigitMask
int getDigitMask()The digit mask is the bit-field covering just the digit's bits (starting at bit 0). Those bits in the mask are set to one which are required to represent a digit.- Returns:
- the digit mask
-
toValue
int toValue(char aChar) Retrieves the (decoded) value for the (encoded) character.- Parameters:
aChar- the char- Returns:
- the int
-
toChar
char toChar(int aValue) Retrieves the (encoded) character for the (decoded) value.- Parameters:
aValue- the value- Returns:
- the char
-
toPaddingCharsNumber
default int toPaddingCharsNumber(int aSize) Determines the number of padding characters to be appended to data of a given number of bytes to be encoded.- Parameters:
aSize- The size for which to determine the number of padding characters.- Returns:
- The according number of padding characters.
-
toPaddingChars
Determines the paddingStringto be appended to data of the given number of bytes to be encoded.- Parameters:
aSize- The size for which to determine the number of padding characters.- Returns:
- The according padding
String.
-