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
Constructor Summary |
AbstractDebugObject(String n,
byte[] b)
Create a debugging object and ignore the attribute incoming
创建一个调试对象,忽略incoming属性 |
AbstractDebugObject(String n,
byte[] b,
boolean i)
create a debugging object
创建一个调试对象 |
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
包体的åå…进制å—符串形å¼