Interface BaseMetrics

  • 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.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
      int getBitsPerDigit()
      Number in bits for one digit.
      int getBytesPerBlock()
      Number of bytes to exactly fit into an encoded block.
      int getBytesPerInt()
      Number of bytes to exactly store a minimum number of digits.
      char[] getCharSet()
      int getDigitMask()
      The digit mask is the bit-field covering just the digit's bits (starting at bit 0).
      default int getDigitsPerBlock()
      The size of a digits-block, any String of digits not being a multiple of the digits-block size requires padding chars.
      int getDigitsPerByte()
      Number of digits required to represent a byte.
      int getDigitsPerInt()
      Number of digits stored in an integer.
      char toChar​(int aValue)
      Retrieves the (encoded) character for the (decoded) value.
      default String toPaddingChars​(int aSize)
      Determines the padding String to be appended to data of the given number of bytes to be encoded.
      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.
      int toValue​(char aChar)
      Retrieves the (decoded) value for the (encoded) character.
      • Methods inherited from interface org.refcodes.numerical.NumberBaseAccessor

        getNumberBase
      • Methods inherited from interface org.refcodes.numerical.PaddingCharAccessor

        getPaddingChar
    • Method Detail

      • getCharSet

        char[] getCharSet()
        Specified by:
        getCharSet in interface org.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, any String of 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

        default String toPaddingChars​(int aSize)
        Determines the padding String to 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.