advancedrelay.laygo
Class ProtocolEvent

java.lang.Object
  |
  +--advancedrelay.laygo.ProtocolEvent
All Implemented Interfaces:
ProtocolEventObject
Direct Known Subclasses:
DataEvent

public class ProtocolEvent
extends java.lang.Object
implements ProtocolEventObject

Encapsulates the successful result of a poll() or event(). The byte array may not be full, so the index of the first unused byte is stored as the size. The data may be null and/or the size 0.

The constructor which converts a ProtocolEventObject to a ProtocolEvent is intended for the purpose of converting ProtocolEventExceptions into normal events.


Constructor Summary
ProtocolEvent()
           
ProtocolEvent(int type)
           
ProtocolEvent(int type, byte[] data, int size)
           
ProtocolEvent(int type, int size)
           
ProtocolEvent(ProtocolEventObject event)
           
 
Method Summary
 byte[] getData()
           
 int getDataSize()
           
 int getType()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProtocolEvent

public ProtocolEvent()

ProtocolEvent

public ProtocolEvent(int type)

ProtocolEvent

public ProtocolEvent(int type,
                     byte[] data,
                     int size)

ProtocolEvent

public ProtocolEvent(int type,
                     int size)

ProtocolEvent

public ProtocolEvent(ProtocolEventObject event)
Method Detail

getData

public byte[] getData()
Specified by:
getData in interface ProtocolEventObject

getDataSize

public int getDataSize()
Specified by:
getDataSize in interface ProtocolEventObject

getType

public int getType()
Specified by:
getType in interface ProtocolEventObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object