test_class.declarator: logger = LoggerFactory.getLogger(DataCodingTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(DataCodingTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-gsm/src/test/java/com/cloudhopper/commons/gsm/DataCodingTest.java
test_class.identifier: DataCodingTest
test_case.body: @Test
      public void parse() {
          DataCoding dc = DataCoding.parse(DataCoding.CHAR_ENC_DEFAULT);
          Assert.assertEquals((byte)0x00, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_DEFAULT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.CHARACTER_ENCODING, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          dc = DataCoding.parse(DataCoding.CHAR_ENC_8BIT);
          Assert.assertEquals((byte)0x04, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_8BIT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.CHARACTER_ENCODING, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          dc = DataCoding.parse(DataCoding.CHAR_ENC_IA5);
          Assert.assertEquals((byte)0x01, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_IA5, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.CHARACTER_ENCODING, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          dc = DataCoding.parse(DataCoding.CHAR_ENC_UCS2);
          Assert.assertEquals((byte)0x08, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_UCS2, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.CHARACTER_ENCODING, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of -15 used
          dc = DataCoding.parse((byte)-15);
          Assert.assertEquals((byte)0xF1, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_DEFAULT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.MESSAGE_CLASS, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_1, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of 16 used
          dc = DataCoding.parse((byte)16);
          Assert.assertEquals((byte)16, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_DEFAULT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of 17 used
          dc = DataCoding.parse((byte)17);
          Assert.assertEquals((byte)17, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_DEFAULT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_1, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of 20 used
          dc = DataCoding.parse((byte)20);
          Assert.assertEquals((byte)20, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_8BIT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of 21 used
          dc = DataCoding.parse((byte)21);
          Assert.assertEquals((byte)21, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_8BIT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_1, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // common to see a byte value of 21 used
          dc = DataCoding.parse((byte)21);
          Assert.assertEquals((byte)21, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_8BIT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_1, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // 1C is a reserved character encoding!
          dc = DataCoding.parse((byte)0x1C);
          Assert.assertEquals(DataCoding.CHAR_ENC_DEFAULT, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.RESERVED, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // very complicated general data coding 111011
          dc = DataCoding.parse((byte)0x3B);
          Assert.assertEquals((byte)0x3B, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_UCS2, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.GENERAL, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_3, dc.getMessageClass());
          Assert.assertEquals(true, dc.isCompressed());
  
          // message waiting indication group
          dc = DataCoding.parse((byte)0xEA);
          Assert.assertEquals((byte)0xEA, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_UCS2, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.MESSAGE_WAITING_INDICATION, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_0, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
  
          // 0xFD = 1111 11 01 -> should be UCS2
          /** NOTE: 0xFD is not a valid DCS value
          dc = DataCoding.parse((byte)0xFD);
          Assert.assertEquals((byte)0xFD, dc.getByteValue());
          Assert.assertEquals(DataCoding.CHAR_ENC_UCS2, dc.getCharacterEncoding());
          Assert.assertEquals(DataCoding.Group.MESSAGE_CLASS, dc.getCodingGroup());
          Assert.assertEquals(DataCoding.MESSAGE_CLASS_1, dc.getMessageClass());
          Assert.assertEquals(false, dc.isCompressed());
           */
      }
test_case.class_method_signature: DataCodingTest.parse()
test_case.full_signature: @Test public void parse()
test_case.identifier: parse
test_case.invocations: parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed parse assertEquals getByteValue assertEquals getCharacterEncoding assertEquals getCodingGroup assertEquals getMessageClass assertEquals isCompressed
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parse()
focal_class.declarator: MESSAGE_CLASS_0 = 0
focal_class.modifier: public static final
focal_class.original_string: public static final byte MESSAGE_CLASS_0 = 0;
focal_class.type: byte
focal_class.var_name: MESSAGE_CLASS_0
focal_class.declarator: MESSAGE_CLASS_1 = 1
focal_class.modifier: public static final
focal_class.original_string: public static final byte MESSAGE_CLASS_1 = 1;
focal_class.type: byte
focal_class.var_name: MESSAGE_CLASS_1
focal_class.declarator: MESSAGE_CLASS_2 = 2
focal_class.modifier: public static final
focal_class.original_string: public static final byte MESSAGE_CLASS_2 = 2;
focal_class.type: byte
focal_class.var_name: MESSAGE_CLASS_2
focal_class.declarator: MESSAGE_CLASS_3 = 3
focal_class.modifier: public static final
focal_class.original_string: public static final byte MESSAGE_CLASS_3 = 3;
focal_class.type: byte
focal_class.var_name: MESSAGE_CLASS_3
focal_class.declarator: CHAR_ENC_DEFAULT = 0x00
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_DEFAULT = 0x00;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_DEFAULT
focal_class.declarator: CHAR_ENC_IA5 = 0x01
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_IA5 = 0x01;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_IA5
focal_class.declarator: CHAR_ENC_8BITA = 0x02
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_8BITA = 0x02;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_8BITA
focal_class.declarator: CHAR_ENC_LATIN1 = 0x03
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_LATIN1 = 0x03;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_LATIN1
focal_class.declarator: CHAR_ENC_8BIT = 0x04
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_8BIT = 0x04;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_8BIT
focal_class.declarator: CHAR_ENC_JIS = 0x05
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_JIS = 0x05;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_JIS
focal_class.declarator: CHAR_ENC_CYRLLIC = 0x06
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_CYRLLIC = 0x06;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_CYRLLIC
focal_class.declarator: CHAR_ENC_HEBREW = 0x07
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_HEBREW = 0x07;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_HEBREW
focal_class.declarator: CHAR_ENC_UCS2 = 0x08
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_UCS2 = 0x08;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_UCS2
focal_class.declarator: CHAR_ENC_PICTO = 0x09
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_PICTO = 0x09;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_PICTO
focal_class.declarator: CHAR_ENC_MUSIC = 0x0A
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_MUSIC = 0x0A;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_MUSIC
focal_class.declarator: CHAR_ENC_RSRVD = 0x0B
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_RSRVD = 0x0B;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_RSRVD
focal_class.declarator: CHAR_ENC_RSRVD2 = 0x0C
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_RSRVD2 = 0x0C;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_RSRVD2
focal_class.declarator: CHAR_ENC_EXKANJI = 0x0D
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_EXKANJI = 0x0D;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_EXKANJI
focal_class.declarator: CHAR_ENC_KSC5601 = 0x0E
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_KSC5601 = 0x0E;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_KSC5601
focal_class.declarator: CHAR_ENC_RSRVD3 = 0x0F
focal_class.modifier: public static final
focal_class.original_string: public static final byte CHAR_ENC_RSRVD3 = 0x0F;
focal_class.type: byte
focal_class.var_name: CHAR_ENC_RSRVD3
focal_class.declarator: dcs
focal_class.modifier: private final
focal_class.original_string: private final byte dcs;
focal_class.type: byte
focal_class.var_name: dcs
focal_class.declarator: codingGroup
focal_class.modifier: private final
focal_class.original_string: private final Group codingGroup;
focal_class.type: Group
focal_class.var_name: codingGroup
focal_class.declarator: characterEncoding
focal_class.modifier: private final
focal_class.original_string: private final byte characterEncoding;
focal_class.type: byte
focal_class.var_name: characterEncoding
focal_class.declarator: messageClass
focal_class.modifier: private final
focal_class.original_string: private final byte messageClass;
focal_class.type: byte
focal_class.var_name: messageClass
focal_class.declarator: compressed
focal_class.modifier: private final
focal_class.original_string: private final boolean compressed;
focal_class.type: boolean
focal_class.var_name: compressed
focal_class.file: ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/DataCoding.java
focal_class.identifier: DataCoding
focal_class.class_method_signature: DataCoding.DataCoding(byte dcs, Group codingGroup, byte characterEncoding, byte messageClass, boolean compressed)
focal_class.full_signature: protected  DataCoding(byte dcs, Group codingGroup, byte characterEncoding, byte messageClass, boolean compressed)
focal_class.identifier: DataCoding
focal_class.modifiers: protected
focal_class.parameters: (byte dcs, Group codingGroup, byte characterEncoding, byte messageClass, boolean compressed)
focal_class.signature:  DataCoding(byte dcs, Group codingGroup, byte characterEncoding, byte messageClass, boolean compressed)
focal_class.class_method_signature: DataCoding.getByteValue()
focal_class.full_signature: public byte getByteValue()
focal_class.identifier: getByteValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getByteValue()
focal_class.class_method_signature: DataCoding.getCodingGroup()
focal_class.full_signature: public Group getCodingGroup()
focal_class.identifier: getCodingGroup
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Group
focal_class.signature: Group getCodingGroup()
focal_class.class_method_signature: DataCoding.getCharacterEncoding()
focal_class.full_signature: public byte getCharacterEncoding()
focal_class.identifier: getCharacterEncoding
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getCharacterEncoding()
focal_class.class_method_signature: DataCoding.getMessageClass()
focal_class.full_signature: public byte getMessageClass()
focal_class.identifier: getMessageClass
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: byte
focal_class.signature: byte getMessageClass()
focal_class.class_method_signature: DataCoding.isCompressed()
focal_class.full_signature: public boolean isCompressed()
focal_class.identifier: isCompressed
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isCompressed()
focal_class.class_method_signature: DataCoding.createCharacterEncodingGroup(byte characterEncoding)
focal_class.full_signature: static public DataCoding createCharacterEncodingGroup(byte characterEncoding)
focal_class.identifier: createCharacterEncodingGroup
focal_class.modifiers: static public
focal_class.parameters: (byte characterEncoding)
focal_class.return: DataCoding
focal_class.signature: DataCoding createCharacterEncodingGroup(byte characterEncoding)
focal_class.class_method_signature: DataCoding.createMessageClassGroup(byte characterEncoding, byte messageClass)
focal_class.full_signature: static public DataCoding createMessageClassGroup(byte characterEncoding, byte messageClass)
focal_class.identifier: createMessageClassGroup
focal_class.modifiers: static public
focal_class.parameters: (byte characterEncoding, byte messageClass)
focal_class.return: DataCoding
focal_class.signature: DataCoding createMessageClassGroup(byte characterEncoding, byte messageClass)
focal_class.class_method_signature: DataCoding.createGeneralGroup(byte characterEncoding, Byte messageClass, boolean compressed)
focal_class.full_signature: static public DataCoding createGeneralGroup(byte characterEncoding, Byte messageClass, boolean compressed)
focal_class.identifier: createGeneralGroup
focal_class.modifiers: static public
focal_class.parameters: (byte characterEncoding, Byte messageClass, boolean compressed)
focal_class.return: DataCoding
focal_class.signature: DataCoding createGeneralGroup(byte characterEncoding, Byte messageClass, boolean compressed)
focal_class.class_method_signature: DataCoding.createMessageWaitingIndicationGroup(byte characterEncoding, boolean store, boolean active, byte indicatorType)
focal_class.full_signature: static public DataCoding createMessageWaitingIndicationGroup(byte characterEncoding, boolean store, boolean active, byte indicatorType)
focal_class.identifier: createMessageWaitingIndicationGroup
focal_class.modifiers: static public
focal_class.parameters: (byte characterEncoding, boolean store, boolean active, byte indicatorType)
focal_class.return: DataCoding
focal_class.signature: DataCoding createMessageWaitingIndicationGroup(byte characterEncoding, boolean store, boolean active, byte indicatorType)
focal_class.class_method_signature: DataCoding.createReservedGroup(byte dcs)
focal_class.full_signature: static public DataCoding createReservedGroup(byte dcs)
focal_class.identifier: createReservedGroup
focal_class.modifiers: static public
focal_class.parameters: (byte dcs)
focal_class.return: DataCoding
focal_class.signature: DataCoding createReservedGroup(byte dcs)
focal_class.class_method_signature: DataCoding.parse(byte dcs)
focal_class.full_signature: static public DataCoding parse(byte dcs)
focal_class.identifier: parse
focal_class.modifiers: static public
focal_class.parameters: (byte dcs)
focal_class.return: DataCoding
focal_class.signature: DataCoding parse(byte dcs)
focal_method.body: static public DataCoding parse(byte dcs) {
          try {
              // if bits 7 thru 4 are all off, this represents a simple character encoding group
              if ((dcs & (byte)0xF0) == 0x00) {
                  // the raw dcs value is exactly our 16 possible languaged
                  return createCharacterEncodingGroup(dcs);
  
              // if bits 7 thru 4 are all on, this represents a message class group
              } else if ((dcs & (byte)0xF0) == (byte)0xF0) {
                  // bit 2 is the language encoding
                  byte characterEncoding = CHAR_ENC_DEFAULT;
                  if ((dcs & (byte)0x04) == (byte)0x04) {
                      characterEncoding = CHAR_ENC_8BIT;
                  }
  
                  // bits 1 thru 0 is the message class
                  byte messageClass = (byte)(dcs & (byte)0x03);
  
                  return createMessageClassGroup(characterEncoding, messageClass);
  
              // at this point if bits 7 and 6 are off, then general data coding group
              } else if ((dcs & (byte)0xC0) == (byte)0x00) {
                  // bit 5 represents "compression"
                  boolean compressed = false;
                  if ((dcs & (byte)0x20) == (byte)0x20) {
                      compressed = true;
                  }
  
                  // bits 1 thru 0 is the message class
                  byte tempMessageClass = (byte)(dcs & (byte)0x03);
  
                  Byte messageClass = null;
                  // bit 4 on means the message class becomes used
                  if ((dcs & (byte)0x10) == (byte)0x10) {
                      messageClass = new Byte(tempMessageClass);
                  }
  
                  // bits 3 and 2 represent the language encodings (nicely match default, 8-bit, or UCS2)
                  byte characterEncoding = (byte)(dcs & (byte)0x0C);
  
                  return createGeneralGroup(characterEncoding, messageClass, compressed);
  
              // at this point if bits 7 and 6 are on, then bits 5 and 4 determine MWI
              } else if ((dcs & (byte)0xC0) == (byte)0xC0) {
                  // bit 5: 0=default, 1=UCS2
                  byte characterEncoding = CHAR_ENC_DEFAULT;
                  if ((byte)(dcs & (byte)0x20) == 0x20) {
                      characterEncoding = CHAR_ENC_UCS2;
                  }
  
                  // bit 4: 0=discard, 1=store
                  boolean store = false;
                  if ((byte)(dcs & (byte)0x10) == 0x10) {
                      store = true;
                  }
  
                  // bit 3: indicator active
                  boolean indicatorActive = false;
                  if ((byte)(dcs & (byte)0x08) == 0x08) {
                      indicatorActive = true;
                  }
  
                  // bit 2: means nothing
  
                  // bit 1 thru 0 is the type of indicator
                  byte indicatorType = (byte)(dcs & (byte)0x03);
  
                  return createMessageWaitingIndicationGroup(characterEncoding, store, indicatorActive, indicatorType);
  
              } else {
                  return createReservedGroup(dcs);
              }
          } catch (IllegalArgumentException e) {
              return createReservedGroup(dcs);
          }
      }
focal_method.class_method_signature: DataCoding.parse(byte dcs)
focal_method.full_signature: static public DataCoding parse(byte dcs)
focal_method.identifier: parse
focal_method.invocations: createCharacterEncodingGroup createMessageClassGroup createGeneralGroup createMessageWaitingIndicationGroup createReservedGroup createReservedGroup
focal_method.modifiers: static public
focal_method.parameters: (byte dcs)
focal_method.return: DataCoding
focal_method.signature: DataCoding parse(byte dcs)