net.sf.cscc
Class DataEvent

java.lang.Object
  |
  +--net.sf.cscc.DataEvent

public class DataEvent
extends java.lang.Object
implements java.io.Serializable

This class encapsulates the data which is associated with a specific data event that occurred.

Author
Silvio Meier (SM)

Copyright
Silvio Meier, Tobias Reinhard, 2003

History
2003-05-09 SM First Version
2003-05-14 SM working on additional methods and events,
correction of some comments.
2003-05-21 SM Added methods for retrieving the client id
if the data event was received by a server.
2006-11-02 SM Comments revised.

Version
$Date: 2007/07/02 21:26:17 $, $Author: reode_orm $, $Revision: 1.2 $

See Also
Serialized Form

Field Summary
protected  java.lang.Object clientId
          This variable refers to the object identifying the sender client uniquely.
protected  java.lang.Object data
          This field refers to the data which is encapsulated in this DataEvent.
protected  java.lang.Object eventKey
          This variable stores a key which identifies the event uniquely.
 
Constructor Summary
DataEvent(java.lang.Object key, java.lang.Object data)
          Constructor initializes the object.
 
Method Summary
 java.lang.Object getClientId()
          This method returns the client id which is represented as an object.
 java.lang.Object getData()
          This method returns the encapsulated event data.
 java.lang.Object getEventKey()
          This method returns the event key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventKey

protected java.lang.Object eventKey
This variable stores a key which identifies the event uniquely. This key can be any object and helps the user to determine which kind of data is encapsulated in this DataEvent object.

data

protected java.lang.Object data
This field refers to the data which is encapsulated in this DataEvent.

clientId

protected java.lang.Object clientId
This variable refers to the object identifying the sender client uniquely.
Constructor Detail

DataEvent

public DataEvent(java.lang.Object key,
                 java.lang.Object data)
Constructor initializes the object.
Pre
key != null && data != null
Post
true
Parameters:
key - Key which identifies the type of the event which occurred. The content of this key can be used to determine which type of data is transmitted
data - The data which should be transmitted. The class of this object must implement the interface Serializable. All of the directly or indirectly intransiently referenced data objects must implement this interface.

Method Detail

getData

public java.lang.Object getData()
This method returns the encapsulated event data. The type of the object can be determined by using the event key. This is done by calling the method getEventKey().
Pre
true
Post
true
Returns:
Returns the object containing the data which is associated with the occurring event.


getEventKey

public java.lang.Object getEventKey()
This method returns the event key. The event key information can be used to determine which kind of data is encapsulated within this object.
Pre
true
Post
true
Returns:
Returns the event key of this event.


getClientId

public java.lang.Object getClientId()
This method returns the client id which is represented as an object. The sender client Id is set if the DataEvent object is received at a target client. This id object is used to identify from which client this DataEvent was sent. If the data event is received by the server, null is returned.
Pre
true
Post
true
Returns:
Returns the client id as object, if this DataEvent object is received by the server.



Copyright © 2003, Silvio Meier and Tobias Reinhard. All Rights Reserved.