-
- 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.NumberBaseAccessorTheBaseMetricsprovide the metrics for a codec to be used by an implementation of theBaseBuilder, theBaseDecoder, theBaseEncoderor 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.CharSetProperty
-
Nested 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.NumberBaseProperty
-
Nested 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intgetBitsPerDigit()Number in bits for one digit.intgetBytesPerBlock()Number of bytes to exactly fit into an encoded block.intgetBytesPerInt()Number of bytes to exactly store a minimum number of digits.char[]getCharSet()intgetDigitMask()The digit mask is the bit-field covering just the digit's bits (starting at bit 0).default intgetDigitsPerBlock()The size of a digits-block, anyStringof digits not being a multiple of the digits-block size requires padding chars.intgetDigitsPerByte()Number of digits required to represent a byte.intgetDigitsPerInt()Number 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.
-
-
-
Method Detail
-
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.
-
-