com.ibm.sensorevent.model.generic
Class GenericEvent

java.lang.Object
  extended by com.ibm.sensorevent.model.generic.GenericEvent
All Implemented Interfaces:
IGenericEvent, java.io.Serializable
Direct Known Subclasses:
IBMSensorEvent

public class GenericEvent
extends java.lang.Object
implements IGenericEvent, java.io.Serializable

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
protected  java.util.Map groups
          The event's groups indexed by the group name
protected  java.lang.String name
          The event's name
 
Constructor Summary
protected GenericEvent()
          Constructs a GenericEvent
protected GenericEvent(java.lang.String name)
          Constructs a GenericEvent with the specified name
 
Method Summary
 void addGroup(IGenericGroup group)
          Adds a group to this event
 IGenericGroup getGroup(java.lang.String name)
          Returns the group with the specified name
 java.util.Collection getGroups()
          Returns this event's groups as a collection of IGenericGroup
static IGenericEvent getInstance(java.lang.String name)
          Factory method to create an IGenericEvent instance
 java.lang.String getName()
          Returns the event's name
 void removeGroups()
          Removes all groups from this event
 void setGroups(java.util.Collection groups)
          Sets this event's collection of groups
 void setName(java.lang.String name)
          Sets the name of this event
 java.lang.String toString()
          Returns a string representation of this event (for debug purposes)
 IGenericGroup traverseGroupPath(java.util.List path)
          Returns the last nested group specified in path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

name

protected volatile java.lang.String name
The event's name


groups

protected volatile java.util.Map groups
The event's groups indexed by the group name

Constructor Detail

GenericEvent

protected GenericEvent()
Constructs a GenericEvent


GenericEvent

protected GenericEvent(java.lang.String name)
                throws SensorEventException
Constructs a GenericEvent with the specified name

Parameters:
name - the name of the event
Throws:
SensorEventException
Method Detail

getInstance

public static IGenericEvent getInstance(java.lang.String name)
                                 throws SensorEventException
Factory method to create an IGenericEvent instance

Parameters:
name - the name of the event
Throws:
SensorEventException

getName

public java.lang.String getName()
Returns the event's name

Specified by:
getName in interface IGenericEvent

setName

public void setName(java.lang.String name)
             throws SensorEventException
Sets the name of this event

Specified by:
setName in interface IGenericEvent
Throws:
SensorEventException

addGroup

public void addGroup(IGenericGroup group)
              throws SensorEventException
Adds a group to this event

Specified by:
addGroup in interface IGenericEvent
Throws:
SensorEventException

getGroup

public IGenericGroup getGroup(java.lang.String name)
                       throws SensorEventException
Returns the group with the specified name

Specified by:
getGroup in interface IGenericEvent
Throws:
SensorEventException

getGroups

public java.util.Collection getGroups()
Returns this event's groups as a collection of IGenericGroup

Specified by:
getGroups in interface IGenericEvent

removeGroups

public void removeGroups()
Removes all groups from this event

Specified by:
removeGroups in interface IGenericEvent

setGroups

public void setGroups(java.util.Collection groups)
               throws SensorEventException
Sets this event's collection of groups

Specified by:
setGroups in interface IGenericEvent
Throws:
SensorEventException

traverseGroupPath

public IGenericGroup traverseGroupPath(java.util.List path)
                                throws SensorEventException
Returns the last nested group specified in path. If this event contains group A which contains group B which contains group C, a path containing strings "A", "B", "C" returns group C.

Specified by:
traverseGroupPath in interface IGenericEvent
Throws:
SensorEventException

toString

public java.lang.String toString()
Returns a string representation of this event (for debug purposes)

Overrides:
toString in class java.lang.Object


Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.