net.sf.jqql.debug
Class AbstractDebugObject
java.lang.Object
net.sf.jqql.debug.AbstractDebugObject
- All Implemented Interfaces:
- IDebugObject
- Direct Known Subclasses:
- FragmentDO, PacketDO
public abstract class AbstractDebugObject
- extends Object
- implements IDebugObject
Default implementation of interface IDebugObject
IDebugObject接口的缺省实现
- Author:
- luma
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected String name
bytes
protected byte[] bytes
hexString
protected String hexString
incoming
protected boolean incoming
bodyHexString
protected String bodyHexString
bodyBytes
protected byte[] bodyBytes
AbstractDebugObject
public AbstractDebugObject(String n,
byte[] b)
- Create a debugging object and ignore the attribute incoming
创建一个调试对象,忽略incoming属性
- Parameters:
n - name
名称b - byte array
字节数组
AbstractDebugObject
public AbstractDebugObject(String n,
byte[] b,
boolean i)
- create a debugging object
创建一个调试对象
- Parameters:
n - name
名称b - byte array
字节数组i - Indicate whether the packet is received or not
是否接收到的包
getBytes
public byte[] getBytes()
- Specified by:
getBytes in interface IDebugObject
- Returns:
- data's byte array form.
数据的字节数组形式
getHexString
public String getHexString()
- Specified by:
getHexString in interface IDebugObject
- Returns:
- data's hexadecimal string form.
数据的16进制字符串形式
getName
public String getName()
- Specified by:
getName in interface IDebugObject
- Returns:
- data's descriptive name.
数据的描述性名称
setName
public void setName(String name)
- Description copied from interface:
IDebugObject
- set the name.
设置名称
- Specified by:
setName in interface IDebugObject
- Parameters:
name - name
名称
isIncoming
public boolean isIncoming()
- Specified by:
isIncoming in interface IDebugObject
- Returns:
- Return true to indicate data received, false to data sent out.
true表示数据是收到的数据,false表示是发出的数据
getLength
public int getLength()
- Specified by:
getLength in interface IDebugObject
- Returns:
- data byte length
数据字节长度
getBodyBytes
public byte[] getBodyBytes()
- Specified by:
getBodyBytes in interface IDebugObject
- Returns:
- byte array of the packet body.
包体字节数组
getBodyHexString
public String getBodyHexString()
- Specified by:
getBodyHexString in interface IDebugObject
- Returns:
- hexadecimal string form of the packet body
包体的十六进制字符串形式