Prism.core
Class Event

java.lang.Object
  extended by Prism.core.Event
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExtensibleEvent

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

Event represents the basic message that is used by Bricks to communicate.

Version:
2.0
Author:
USC Soft. Arch. Group. Contact: Sam Malek malek@usc.edu
See Also:
Serialized Form

Field Summary
static int EVENT_INITIAL_LENGTH
           
 int eventType
          Event type.
 Brick handlingBrick
          Brick through which this event should be sent
 java.lang.String name
           
 Brick originatingBrick
          Brick that created this event
 java.util.Vector parameterName
           
 java.util.Vector parameterValue
           
 
Constructor Summary
Event()
           
Event(java.lang.String str)
           
Event(java.lang.String str, Brick issuer, IConnector rc)
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.Object value)
          Adds a name-value pair to the event object.
 java.lang.Object getParameter(java.lang.String name)
          Gets a parameter from the event object.
 boolean hasParameter(java.lang.String name)
          Checks to see if the event contains a name-value pair identified by name.
 void removeParameter(java.lang.String name)
          Removes a name-value pair from the event object.
 Event replicate()
          Creates a new Event object that is the exact replica of this Event object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

parameterName

public java.util.Vector parameterName

parameterValue

public java.util.Vector parameterValue

originatingBrick

public transient Brick originatingBrick
Brick that created this event


handlingBrick

public transient Brick handlingBrick
Brick through which this event should be sent


eventType

public int eventType
Event type. Could be a request or reply.


EVENT_INITIAL_LENGTH

public static final int EVENT_INITIAL_LENGTH
See Also:
Constant Field Values
Constructor Detail

Event

public Event()

Event

public Event(java.lang.String str,
             Brick issuer,
             IConnector rc)

Event

public Event(java.lang.String str)
Method Detail

addParameter

public void addParameter(java.lang.String name,
                         java.lang.Object value)
Adds a name-value pair to the event object.

Parameters:
name - String name of the value being stored
value - Object that contains a Java object for the value

hasParameter

public boolean hasParameter(java.lang.String name)
Checks to see if the event contains a name-value pair identified by name.

Returns:
Boolean true if the event contains parameter Name and false if not.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Gets a parameter from the event object.

Parameters:
name - String identifier for the name-value pair being read
Returns:
Object The value being requested. If not found, null is returned

removeParameter

public void removeParameter(java.lang.String name)
Removes a name-value pair from the event object.

Parameters:
name - String the name of the value being removed from the message

replicate

public Event replicate()
Creates a new Event object that is the exact replica of this Event object.

Returns:
Event new cloned Event object