net.esper.pattern
Class MatchedEventMapImpl

java.lang.Object
  extended by net.esper.pattern.MatchedEventMapImpl
All Implemented Interfaces:
MatchedEventMap

public final class MatchedEventMapImpl
extends Object
implements MatchedEventMap

Collection for internal use similar to the MatchedEventMap class in the client package that holds the one or more events that could match any defined event expressions. The optional tag value supplied when an event expression is created is used as a key for placing matching event objects into this collection.


Constructor Summary
MatchedEventMapImpl()
          Constructor creates an empty collection of events.
MatchedEventMapImpl(Map<String,EventBean> events)
          Ctor.
 
Method Summary
 void add(String tag, EventBean event)
          Add an event to the collection identified by the given tag.
 boolean equals(Object otherObject)
           
 EventBean getMatchingEvent(String tag)
          Returns a single event instance given the tag identifier, or null if the tag could not be located.
 Map<String,EventBean> getMatchingEvents()
          Returns a map containing the events where the key is the event tag string and the value is the event instance.
 int hashCode()
           
 void merge(MatchedEventMap other)
          Merge the state of an other match event structure into this one by adding all entries within the MatchedEventMap to this match event.
 MatchedEventMapImpl shallowCopy()
          Make a shallow copy of this collection.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatchedEventMapImpl

public MatchedEventMapImpl()
Constructor creates an empty collection of events.


MatchedEventMapImpl

public MatchedEventMapImpl(Map<String,EventBean> events)
Ctor.

Parameters:
events - is the name-value pairs of tag and event
Method Detail

add

public void add(String tag,
                EventBean event)
Add an event to the collection identified by the given tag.

Specified by:
add in interface MatchedEventMap
Parameters:
tag - is an identifier to retrieve the event from
event - is the event object to be added

getMatchingEvents

public Map<String,EventBean> getMatchingEvents()
Returns a map containing the events where the key is the event tag string and the value is the event instance.

Specified by:
getMatchingEvents in interface MatchedEventMap
Returns:
Hashtable containing event instances

getMatchingEvent

public EventBean getMatchingEvent(String tag)
Returns a single event instance given the tag identifier, or null if the tag could not be located.

Specified by:
getMatchingEvent in interface MatchedEventMap
Parameters:
tag - is the identifier to look for
Returns:
event instances for the tag

equals

public boolean equals(Object otherObject)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

shallowCopy

public MatchedEventMapImpl shallowCopy()
Make a shallow copy of this collection.

Specified by:
shallowCopy in interface MatchedEventMap
Returns:
shallow copy

merge

public void merge(MatchedEventMap other)
Merge the state of an other match event structure into this one by adding all entries within the MatchedEventMap to this match event.

Specified by:
merge in interface MatchedEventMap
Parameters:
other - is the other instance to merge in.