|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.epl.join.table.PropertyIndexedEventTable
public class PropertyIndexedEventTable
Index that organizes events by the event property values into hash buckets. Based on a HashMap
with MultiKeyUntyped
keys that store the property values.
Takes a list of property names as parameter. Doesn't care which event type the events have as long as the properties
exist. If the same event is added twice, the class throws an exception on add.
Field Summary | |
---|---|
protected EventPropertyGetter[] |
propertyGetters
Getters for properties. |
protected Map<MultiKeyUntyped,Set<EventBean>> |
propertyIndex
Index table. |
Constructor Summary | |
---|---|
PropertyIndexedEventTable(int streamNum,
EventType eventType,
String[] propertyNames)
Ctor. |
Method Summary | |
---|---|
void |
add(EventBean[] events)
Add an array of events. |
void |
clear()
Clear out index. |
protected MultiKeyUntyped |
getMultiKey(EventBean event)
Determine multikey for index access. |
boolean |
isEmpty()
Returns true if the index is empty, or false if not |
Iterator<EventBean> |
iterator()
Returns an iterator over events in the table. |
Set<EventBean> |
lookup(Object[] keys)
Returns the set of events that have the same property value as the given event. |
void |
remove(EventBean[] events)
Remove events. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final EventPropertyGetter[] propertyGetters
protected final Map<MultiKeyUntyped,Set<EventBean>> propertyIndex
Constructor Detail |
---|
public PropertyIndexedEventTable(int streamNum, EventType eventType, String[] propertyNames)
streamNum
- - the stream number that is indexedeventType
- - types of events indexedpropertyNames
- - property names to use for indexingMethod Detail |
---|
protected MultiKeyUntyped getMultiKey(EventBean event)
event
- to get properties from for key
public void add(EventBean[] events)
add
in interface EventTable
events
- to add
IllegalArgumentException
- if the event was already existed in the indexpublic void remove(EventBean[] events)
remove
in interface EventTable
events
- to be removed, can be null instead of an empty array.
IllegalArgumentException
- when the event could not be removed as its not in the indexpublic Set<EventBean> lookup(Object[] keys)
keys
- to compare against
public boolean isEmpty()
EventTable
isEmpty
in interface EventTable
public Iterator<EventBean> iterator()
EventTable
iterator
in interface EventTable
public void clear()
EventTable
clear
in interface EventTable
public String toString()
toString
in class Object
|
© 2007 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |