com.espertech.esper.epl.join.table
Class PropertySortedEventTableImpl

java.lang.Object
  extended by com.espertech.esper.epl.join.table.PropertySortedEventTable
      extended by com.espertech.esper.epl.join.table.PropertySortedEventTableImpl
All Implemented Interfaces:
EventTable, java.lang.Iterable<EventBean>
Direct Known Subclasses:
PropertySortedEventTableCoerced

public class PropertySortedEventTableImpl
extends PropertySortedEventTable

Index that organizes events by the event property values into a single TreeMap sortable non-nested index with Object keys that store the property values.


Field Summary
protected  java.util.HashSet<EventBean> nullKeyedValues
           
protected  java.util.TreeMap<java.lang.Object,java.util.Set<EventBean>> propertyIndex
          Index table.
 
Fields inherited from class com.espertech.esper.epl.join.table.PropertySortedEventTable
organization, propertyGetter
 
Constructor Summary
PropertySortedEventTableImpl(EventPropertyGetter propertyGetter, EventTableOrganization organization)
          Ctor.
 
Method Summary
 void add(EventBean theEvent)
          Add event to table.
 void clear()
          Clear out index.
protected  java.lang.Object coerce(java.lang.Object value)
           
 void destroy()
          Destroy index.
 java.lang.Object getIndex()
          Return the index object itself, or an object-array for multiple index structures.
 java.lang.Integer getNumberOfEvents()
          If the number of events is readily available, an implementation will return that number or it may return null to indicate that the count is not readily available.
 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.
 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.
 java.util.Set<EventBean> lookupConstants(RangeIndexLookupValue lookupValueBase)
           
 java.util.Set<EventBean> lookupGreater(java.lang.Object keyStart)
           
 java.util.Collection<EventBean> lookupGreaterColl(java.lang.Object keyStart)
           
 java.util.Set<EventBean> lookupGreaterEqual(java.lang.Object keyStart)
           
 java.util.Collection<EventBean> lookupGreaterEqualColl(java.lang.Object keyStart)
           
 java.util.Set<EventBean> lookupLess(java.lang.Object keyStart)
           
 java.util.Set<EventBean> lookupLessEqual(java.lang.Object keyStart)
           
 java.util.Collection<EventBean> lookupLessEqualColl(java.lang.Object keyStart)
           
 java.util.Collection<EventBean> lookupLessThenColl(java.lang.Object keyStart)
           
 java.util.Set<EventBean> lookupRange(java.lang.Object keyStart, boolean includeStart, java.lang.Object keyEnd, boolean includeEnd, boolean allowRangeReversal)
          Returns the set of events that have the same property value as the given event.
 java.util.Collection<EventBean> lookupRangeColl(java.lang.Object keyStart, boolean includeStart, java.lang.Object keyEnd, boolean includeEnd, boolean allowRangeReversal)
           
 java.util.Set<EventBean> lookupRangeInverted(java.lang.Object keyStart, boolean includeStart, java.lang.Object keyEnd, boolean includeEnd)
           
 java.util.Collection<EventBean> lookupRangeInvertedColl(java.lang.Object keyStart, boolean includeStart, java.lang.Object keyEnd, boolean includeEnd)
           
 void remove(EventBean theEvent)
          Remove event from table.
 
Methods inherited from class com.espertech.esper.epl.join.table.PropertySortedEventTable
add, addRemove, getIndexedValue, getOrganization, normalize, normalize, normalizeCollection, normalizeCollection, remove, toQueryPlan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyIndex

protected final java.util.TreeMap<java.lang.Object,java.util.Set<EventBean>> propertyIndex
Index table.


nullKeyedValues

protected final java.util.HashSet<EventBean> nullKeyedValues
Constructor Detail

PropertySortedEventTableImpl

public PropertySortedEventTableImpl(EventPropertyGetter propertyGetter,
                                    EventTableOrganization organization)
Ctor.

Method Detail

coerce

protected java.lang.Object coerce(java.lang.Object value)

lookupRange

public java.util.Set<EventBean> lookupRange(java.lang.Object keyStart,
                                            boolean includeStart,
                                            java.lang.Object keyEnd,
                                            boolean includeEnd,
                                            boolean allowRangeReversal)
Returns the set of events that have the same property value as the given event.

Specified by:
lookupRange in class PropertySortedEventTable
Parameters:
keyStart - to compare against
keyEnd - to compare against
allowRangeReversal - indicate whether "a between 60 and 50" should return no results (equivalent to a>= X and a <=Y) or should return results (equivalent to 'between' and 'in'
Returns:
set of events with property value, or null if none found (never returns zero-sized set)

lookupRangeColl

public java.util.Collection<EventBean> lookupRangeColl(java.lang.Object keyStart,
                                                       boolean includeStart,
                                                       java.lang.Object keyEnd,
                                                       boolean includeEnd,
                                                       boolean allowRangeReversal)
Specified by:
lookupRangeColl in class PropertySortedEventTable

lookupRangeInverted

public java.util.Set<EventBean> lookupRangeInverted(java.lang.Object keyStart,
                                                    boolean includeStart,
                                                    java.lang.Object keyEnd,
                                                    boolean includeEnd)
Specified by:
lookupRangeInverted in class PropertySortedEventTable

lookupRangeInvertedColl

public java.util.Collection<EventBean> lookupRangeInvertedColl(java.lang.Object keyStart,
                                                               boolean includeStart,
                                                               java.lang.Object keyEnd,
                                                               boolean includeEnd)
Specified by:
lookupRangeInvertedColl in class PropertySortedEventTable

lookupLess

public java.util.Set<EventBean> lookupLess(java.lang.Object keyStart)
Specified by:
lookupLess in class PropertySortedEventTable

lookupLessThenColl

public java.util.Collection<EventBean> lookupLessThenColl(java.lang.Object keyStart)
Specified by:
lookupLessThenColl in class PropertySortedEventTable

lookupLessEqual

public java.util.Set<EventBean> lookupLessEqual(java.lang.Object keyStart)
Specified by:
lookupLessEqual in class PropertySortedEventTable

lookupLessEqualColl

public java.util.Collection<EventBean> lookupLessEqualColl(java.lang.Object keyStart)
Specified by:
lookupLessEqualColl in class PropertySortedEventTable

lookupGreaterEqual

public java.util.Set<EventBean> lookupGreaterEqual(java.lang.Object keyStart)
Specified by:
lookupGreaterEqual in class PropertySortedEventTable

lookupGreaterEqualColl

public java.util.Collection<EventBean> lookupGreaterEqualColl(java.lang.Object keyStart)
Specified by:
lookupGreaterEqualColl in class PropertySortedEventTable

lookupGreater

public java.util.Set<EventBean> lookupGreater(java.lang.Object keyStart)
Specified by:
lookupGreater in class PropertySortedEventTable

lookupGreaterColl

public java.util.Collection<EventBean> lookupGreaterColl(java.lang.Object keyStart)
Specified by:
lookupGreaterColl in class PropertySortedEventTable

getNumberOfEvents

public java.lang.Integer getNumberOfEvents()
Description copied from interface: EventTable
If the number of events is readily available, an implementation will return that number or it may return null to indicate that the count is not readily available.

Specified by:
getNumberOfEvents in interface EventTable
Overrides:
getNumberOfEvents in class PropertySortedEventTable
Returns:
number of events

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

getIndex

public 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

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.


lookupConstants

public java.util.Set<EventBean> lookupConstants(RangeIndexLookupValue lookupValueBase)
Specified by:
lookupConstants in class PropertySortedEventTable

getProviderClass

public java.lang.Class getProviderClass()

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