📄 addlocuser.java
字号:
/**
* <p>Title: 位置信息管理模块同定位前置的包解析</p>
* <p>Description: 定位前置 向位置信息管理模块返回位置信息报告的操作包</p>
* <p>Company: 福富软件 </p>
* @author chenxin
* @version 1.0 $Date 2007-07-05
*/
package ffcs.lbp.le.message;
import java.nio.ByteBuffer;
import ffcs.lbp.LbpMessage;
import ffcs.lbp.MessageParseException;
public class AddLocUser extends LeMessage {
private String Isdn =null;
private long AvailTime;
private int lenIsdn=36;
private int lenAvailTime=4;
private int lenMessageBody=lenIsdn + lenAvailTime;
public AddLocUser() {
super(AddLocUser);
}
public int getBodyLength() {
return lenMessageBody;
}
/**
* 读取协议包的包体
* @param buf ByteBuffer
* @throws MessageParseException
* @return boolean
*/
protected boolean readBody(ByteBuffer buf) throws
LeProtocolException{
Isdn=readOString(buf,lenIsdn);
AvailTime=buf.getLong();
return true;
}
/**
* 读取协议包的包体
* @param buf ByteBuffer
* @return boolean
*/
protected boolean writeBody(ByteBuffer buf){
return true;
}
/**
* Convert this packet to a String. Not to be interpreted programmatically,
* it's just dead handy for debugging!
*/
public String toString() {
StringBuffer sb=new StringBuffer("AddLocUser:");
sb.append(super.toString());
sb.append("Isdn");
sb.append("=");
sb.append(Isdn);
sb.append(" ");
sb.append("AvailTime");
sb.append("=");
sb.append(AvailTime);
sb.append(" ");
return sb.toString();
}
public String getIsdn() {
return Isdn;
}
public void setIsdn(String isdn) {
ByteBuffer buf =ByteBuffer.allocate(lenIsdn-1);
LbpMessage.writeOString(buf, isdn, lenIsdn-1);
Isdn = new String(buf.array());
}
public long getAvailTime() {
return AvailTime;
}
public void setAvailTime(long availTime) {
AvailTime = availTime;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -