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 char
decodeChar(int digit)
Gets the decoded character from an encoded value.int
encodeChar(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:CharCodec
Gets the encoded value for a character.- Specified by:
encodeChar
in interfaceCharCodec
- 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 interfaceCharCodec
- Parameters:
digit
- the encoded form of the character.- Returns:
- the decoded character
-
-