com.espertech.esper.pattern
Class MatchedEventMapImpl

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

public final class MatchedEventMapImpl
extends java.lang.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(MatchedEventMapMeta meta)
          Constructor creates an empty collection of events.
MatchedEventMapImpl(MatchedEventMapMeta meta, java.lang.Object[] matches)
           
 
Method Summary
 void add(int tag, java.lang.Object theEvent)
          Add an event to the collection identified by the given tag.
 EventBean getMatchingEvent(int tag)
          Returns a single event instance given the tag identifier, or null if the tag could not be located.
 java.lang.Object getMatchingEventAsObject(int tag)
          Returns the object for the matching event, be it the event bean array or the event bean.
 java.lang.Object getMatchingEventAsObjectByTag(java.lang.String key)
           
 EventBean getMatchingEventByTag(java.lang.String resultEventAsName)
           
 java.lang.Object[] getMatchingEvents()
          Returns a map containing the events where the key is the event tag string and the value is the event instance.
 java.util.Map<java.lang.String,java.lang.Object> getMatchingEventsAsMap()
           
 MatchedEventMapMeta getMeta()
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatchedEventMapImpl

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

Parameters:
meta - metadata

MatchedEventMapImpl

public MatchedEventMapImpl(MatchedEventMapMeta meta,
                           java.lang.Object[] matches)
Method Detail

add

public void add(int tag,
                java.lang.Object theEvent)
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
theEvent - is the event object or array of event object to be added

getMatchingEvents

public java.lang.Object[] 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(int 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

getMatchingEventAsObject

public java.lang.Object getMatchingEventAsObject(int tag)
Description copied from interface: MatchedEventMap
Returns the object for the matching event, be it the event bean array or the event bean.

Specified by:
getMatchingEventAsObject in interface MatchedEventMap
Parameters:
tag - is the tag to return the object for
Returns:
event bean or event bean array

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.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.

getMatchingEventsAsMap

public java.util.Map<java.lang.String,java.lang.Object> getMatchingEventsAsMap()
Specified by:
getMatchingEventsAsMap in interface MatchedEventMap

getMeta

public MatchedEventMapMeta getMeta()
Specified by:
getMeta in interface MatchedEventMap

getMatchingEventByTag

public EventBean getMatchingEventByTag(java.lang.String resultEventAsName)
Specified by:
getMatchingEventByTag in interface MatchedEventMap

getMatchingEventAsObjectByTag

public java.lang.Object getMatchingEventAsObjectByTag(java.lang.String key)
Specified by:
getMatchingEventAsObjectByTag in interface MatchedEventMap

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com