com.ibm.tspaces
Class TupleSpaceEvent

java.lang.Object
  |
  +--com.ibm.tspaces.TupleSpaceEvent

public class TupleSpaceEvent
extends java.lang.Object

This class implements tuplespace event. The event contains an id which indicates the type of event it is and which other Event variables are relavent for the event.

Author:
Matthias Eichstaedt

Field Summary
 TupleSpaceEvent evt
          The next event.
 int id
          The type of this event.
 java.lang.String source
          The space name where the event was triggered.
 SuperTuple superTuple
          A tuple.
static int TUPLE_ADD
          The add-tuple constant.
static int TUPLE_REMOVE
          The removed-tuple constant.
static int UPDATE
          The update constant.
 
Constructor Summary
TupleSpaceEvent(java.lang.String source, int id, SuperTuple superTuple)
          Constructs an event from the specified tuplespace, event type, and tuple
 
Method Summary
 boolean add()
          Checks if this is an add event.
 int getID()
          Return the type of this event.
 SuperTuple getTuple()
          Return the tuple of this event.
 boolean remove()
          Checks if this is a remove event.
 java.lang.String toString()
          Return a string representation of this event.
 boolean update()
          Checks if this is an update event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TUPLE_ADD

public static final int TUPLE_ADD
The add-tuple constant.

TUPLE_REMOVE

public static final int TUPLE_REMOVE
The removed-tuple constant.

UPDATE

public static final int UPDATE
The update constant. Use this constant whenever its neither add nor delete. ;-)

source

public java.lang.String source
The space name where the event was triggered.

id

public int id
The type of this event.

superTuple

public SuperTuple superTuple
A tuple.

evt

public TupleSpaceEvent evt
The next event. Used when putting events into a linked list.
Constructor Detail

TupleSpaceEvent

public TupleSpaceEvent(java.lang.String source,
                       int id,
                       SuperTuple superTuple)
Constructs an event from the specified tuplespace, event type, and tuple
Parameters:
source - - the space name from which the event was triggered
id - - the event type
Method Detail

add

public boolean add()
Checks if this is an add event.
Returns:
boolean - true if this in an add event

remove

public boolean remove()
Checks if this is a remove event.
Returns:
boolean - true if this in a remove event

update

public boolean update()
Checks if this is an update event.
Returns:
boolean - true if this in an update event

getID

public int getID()
Return the type of this event.
Returns:
int - type of this event

getTuple

public SuperTuple getTuple()
Return the tuple of this event.
Returns:
Tuple - this tuple

toString

public java.lang.String toString()
Return a string representation of this event.
Overrides:
toString in class java.lang.Object
Parameters:
String - - string representation