Class BCDCharCodec

    • Constructor Detail

      • BCDCharCodec

        public BCDCharCodec​(String digitMapping)
        Constructs a 3GPP standards-based digit codec customised to the given digit mapping. The digitMapping can use the character ? for invalid digits.
        Parameters:
        digitMapping - String showing how the 16 BCD digits are decoded to address characters
    • Method Detail

      • encodeChar

        public int encodeChar​(char ch)
        Description copied from interface: CharCodec
        Gets the encoded value for a character.
        Specified by:
        encodeChar in interface CharCodec
        Parameters:
        ch - the character to encode
        Returns:
        the encoded form of the character
      • decodeChar

        public char decodeChar​(int digit)
        Description copied from interface: CharCodec
        Gets the decoded character from an encoded value.
        Specified by:
        decodeChar in interface CharCodec
        Parameters:
        digit - the encoded form of the character.
        Returns:
        the decoded character