📄 msgquerymemusergrouprsp.java
字号:
/**
*
*/
package com.aceway.vas.sjcraw.cbgp201.crm.ugm;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import com.aceway.vas.sjcraw.cbgp201.Msg;
/**
* @标题: 华为彩铃平台接口规范
* @说明:
* @版权: Copyright(c) 2007
* @公司: 北京汉铭信通科技有限公司
* @部门: 增值业务部
* @作者: 武达
* @Jun 6, 2007
*/
public class MsgQueryMemUserGroupRsp extends Msg {
private final int LEN_PRE_PHONE=41;
/*
Startnum 4 Integer 起始记录数
Curnum 4 Integer 本次返回记录数
Allnum 4 Integer 记录总数
*/
private int startNum;
private int curNum;
private int allNum;
private Map<Integer, Phone>map = new HashMap<Integer, Phone>();
private class Phone{
/*
Phone(1) 21 String 来电号码
PhoneLabel(1) 20 String 来电号码对应的姓名
*/
public String phone;
public String phoneLabel;
}
/**
* @param bytes
*/
public MsgQueryMemUserGroupRsp(byte[] bytes) {
super(bytes);
ByteBuffer buff = super.getBodyBuffer();
this.startNum = buff.getInt();
this.curNum = buff.getInt();
this.allNum = buff.getInt();
buff = buff.slice();
byte[] msgPhone = new byte[buff.capacity()];
if (buff.capacity()%this.LEN_PRE_PHONE==0 && buff.capacity()/this.LEN_PRE_PHONE==this.curNum){
for (int i=0; i<this.curNum; i++){
byte[] temp = new byte[LEN_PRE_PHONE];
System.arraycopy(msgPhone, i*LEN_PRE_PHONE, temp, 0, temp.length);
Phone phone = new Phone();
try {
phone.phone = new String(temp, 0, 21, "gbk");
phone.phoneLabel = new String(temp, 21, 20, "gbk");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
this.map.put(i, phone);
}
}else {
System.err.print("消息体不正确");
return;
}
}
public int getAllNum() {
return this.allNum;
}
public int getCurNum() {
return this.curNum;
}
public int getStartNum() {
return this.startNum;
}
public String getPhone(int position) {
Phone phone = (Phone)map.get(position);
return phone.phone;
}
public String getPhoneLabel(int position) {
Phone phone = (Phone)map.get(position);
return phone.phoneLabel;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -