com.espertech.esper.epl.join.table
Class PropertyCompositeEventTableImpl
java.lang.Object
com.espertech.esper.epl.join.table.PropertyCompositeEventTable
com.espertech.esper.epl.join.table.PropertyCompositeEventTableImpl
- All Implemented Interfaces:
- EventTable, java.lang.Iterable<EventBean>
public class PropertyCompositeEventTableImpl
- extends PropertyCompositeEventTable
For use when the index comprises of either two or more ranges or a unique key in combination with a range.
Organizes into a TreeMap>, for short. The top level can also be just Map.
Expected at least either (A) one key and one range or (B) zero keys and 2 ranges.
An alternative implementatation could have been based on "TreeMap>>", however the following implication arrive
- not applicable for range-only lookups (since there the key can be the value itself
- not applicable for multiple nested range as ordering not nested
- each add/remove and lookup would also need to construct a key object.
Field Summary |
protected java.util.Map<java.lang.Object,java.lang.Object> |
index
Index table (sorted and/or keyed, always nested). |
Method Summary |
void |
add(EventBean theEvent)
Add event to table. |
void |
clear()
Clear out index. |
void |
destroy()
Destroy index. |
java.util.Map<java.lang.Object,java.lang.Object> |
getIndex()
Return the index object itself, or an object-array for multiple index structures. |
int |
getNumKeys()
If the index retains events using some key-based organization this returns the number of keys,
and may return null to indicate that either the number of keys is not available or
costly to obtain. |
CompositeIndexQueryResultPostProcessor |
getPostProcessor()
|
java.lang.Class |
getProviderClass()
|
boolean |
isEmpty()
Returns true if the index is empty, or false if not |
java.util.Iterator<EventBean> |
iterator()
Returns an iterator over events in the table. |
void |
remove(EventBean theEvent)
Remove event from table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
index
protected final java.util.Map<java.lang.Object,java.lang.Object> index
- Index table (sorted and/or keyed, always nested).
PropertyCompositeEventTableImpl
public PropertyCompositeEventTableImpl(java.lang.Class[] optKeyCoercedTypes,
java.lang.Class[] optRangeCoercedTypes,
EventTableOrganization organization,
boolean isHashKeyed,
CompositeIndexEnterRemove chain)
getIndex
public java.util.Map<java.lang.Object,java.lang.Object> getIndex()
- Description copied from interface:
EventTable
- Return the index object itself, or an object-array for multiple index structures.
May return null if the information is not readily available, i.e. externally maintained index
- Specified by:
getIndex
in interface EventTable
- Specified by:
getIndex
in class PropertyCompositeEventTable
- Returns:
- index object
add
public void add(EventBean theEvent)
- Description copied from interface:
EventTable
- Add event to table.
- Parameters:
theEvent
- to add
remove
public void remove(EventBean theEvent)
- Description copied from interface:
EventTable
- Remove event from table.
- Parameters:
theEvent
- to remove
isEmpty
public boolean isEmpty()
- Description copied from interface:
EventTable
- Returns true if the index is empty, or false if not
- Returns:
- true for empty index
iterator
public java.util.Iterator<EventBean> iterator()
- Description copied from interface:
EventTable
- Returns an iterator over events in the table.
- Returns:
- table iterator
clear
public void clear()
- Description copied from interface:
EventTable
- Clear out index.
destroy
public void destroy()
- Description copied from interface:
EventTable
- Destroy index.
getNumKeys
public int getNumKeys()
- Description copied from interface:
EventTable
- If the index retains events using some key-based organization this returns the number of keys,
and may return null to indicate that either the number of keys is not available or
costly to obtain.
The number returned can be an estimate and may not be accurate.
- Returns:
- number of events
getProviderClass
public java.lang.Class getProviderClass()
getPostProcessor
public CompositeIndexQueryResultPostProcessor getPostProcessor()
- Specified by:
getPostProcessor
in class PropertyCompositeEventTable