tuwien.auto.calimero
Class FrameEvent

java.lang.Object
  extended by java.util.EventObject
      extended by tuwien.auto.calimero.FrameEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MonitorFrameEvent

public class FrameEvent
extends java.util.EventObject

Event to communicate the arrival of a new cEMI or EMI2 frame.

Depending on the type of frame supplied on creation of a new frame event, either getFrame() or getFrameBytes() has to be used to retrieve the associated frame.

See Also:
KNXListener, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FrameEvent(java.lang.Object source, byte[] frame)
          Creates a new frame event for frame.
FrameEvent(java.lang.Object source, CEMI frame)
          Creates a new frame event for frame.
 
Method Summary
 CEMI getFrame()
          Returns the cEMI frame, if supplied at event creation.
 byte[] getFrameBytes()
          Returns the frame as byte array, if supplied at event creation.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameEvent

public FrameEvent(java.lang.Object source,
                  byte[] frame)
Creates a new frame event for frame.

Parameters:
source - the creator of this event
frame - EMI2 L-data frame

FrameEvent

public FrameEvent(java.lang.Object source,
                  CEMI frame)
Creates a new frame event for frame.

Parameters:
source - the creator of this event
frame - cEMI frame
Method Detail

getFrame

public final CEMI getFrame()
Returns the cEMI frame, if supplied at event creation.

Returns:
cEMI frame object, or null

getFrameBytes

public final byte[] getFrameBytes()
Returns the frame as byte array, if supplied at event creation.

Returns:
copy of frame as byte array, or null