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

Constructor Summary
Event(int eventType)
           
Event(java.lang.String name, int eventType)
           
Event(java.lang.String name, int eventType, Brick originatingBrick, IConnector handlingBrick)
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.Object value)
          Adds a name-value pair to the event object.
 int getEventType()
           
 IBrick getHandlingBrick()
           
 java.lang.String getName()
           
 IBrick getOriginatingBrick()
           
 java.lang.Object getParameter(java.lang.String name)
          Gets a parameter from the event object.
 java.util.Vector<java.lang.String> getParameterNames()
           
 java.util.Vector<java.lang.Object> getParameterValues()
           
 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.
 void setHandlingBrick(IBrick handlingBrick)
           
 void setName(java.lang.String name)
           
 void setOriginatingBrick(IBrick originatingBrick)
           
 void setParameterNames(java.util.Vector<java.lang.String> parameterName)
           
 void setParameterValues(java.util.Vector<java.lang.Object> parameterValues)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event(int eventType)

Event

public Event(java.lang.String name,
             int eventType)

Event

public Event(java.lang.String name,
             int eventType,
             Brick originatingBrick,
             IConnector handlingBrick)
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

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

setParameterNames

public void setParameterNames(java.util.Vector<java.lang.String> parameterName)

getParameterNames

public java.util.Vector<java.lang.String> getParameterNames()

setParameterValues

public void setParameterValues(java.util.Vector<java.lang.Object> parameterValues)

getParameterValues

public java.util.Vector<java.lang.Object> getParameterValues()

setOriginatingBrick

public void setOriginatingBrick(IBrick originatingBrick)

getOriginatingBrick

public IBrick getOriginatingBrick()

setHandlingBrick

public void setHandlingBrick(IBrick handlingBrick)

getHandlingBrick

public IBrick getHandlingBrick()

getEventType

public int getEventType()