Class BCDCharCodec
- java.lang.Object
-
- com.opencloud.slee.resources.in.datatypes.BCDCharCodec
-
- All Implemented Interfaces:
CharCodec,Serializable
public class BCDCharCodec extends Object implements CharCodec
Implements a CharCodec for cases of encoding and decoding digits in semi-octets.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCDCharCodec(String digitMapping)Constructs a 3GPP standards-based digit codec customised to the given digit mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description chardecodeChar(int digit)Gets the decoded character from an encoded value.intencodeChar(char ch)Gets the encoded value for a character.
-
-
-
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:CharCodecGets the encoded value for a character.- Specified by:
encodeCharin interfaceCharCodec- Parameters:
ch- the character to encode- Returns:
- the encoded form of the character
-
decodeChar
public char decodeChar(int digit)
Description copied from interface:CharCodecGets the decoded character from an encoded value.- Specified by:
decodeCharin interfaceCharCodec- Parameters:
digit- the encoded form of the character.- Returns:
- the decoded character
-
-