com.espertech.esper.event
Class EventBeanUtility

java.lang.Object
  extended by com.espertech.esper.event.EventBeanUtility

public class EventBeanUtility
extends java.lang.Object

Method to getSelectListEvents events in collections to other collections or other event types.


Constructor Summary
EventBeanUtility()
           
 
Method Summary
static EventBean[] addToArray(EventBean[] array, java.util.Collection<EventBean> eventsToAdd)
          Expand the array passed in by the multiple elements to add.
static EventBean[] addToArray(EventBean[] array, EventBean eventToAdd)
          Expand the array passed in by the single element to add.
static EventBean[] allocatePerStreamShift(EventBean[] eventsPerStream)
           
protected static EventBean[] append(EventBean[] source, EventBean[] append)
          Append arrays.
static void appendEvent(java.io.StringWriter writer, EventBean theEvent)
           
static java.lang.Object coerce(java.lang.Object target, java.lang.Class coercionType)
           
static boolean compareReferences(EventBean[] reference, EventBean[] eventsPerStream)
           
static FragmentEventType createNativeFragmentType(java.lang.Class propertyType, java.lang.Class genericType, EventAdapterService eventAdapterService)
          Create a fragment event type.
static EventBean[] denaturalize(EventBean[] naturals)
           
static EventBean[] flatten(java.util.ArrayDeque<EventBean[]> eventVector)
          Flatten the vector of arrays to an array.
static UniformPair<java.util.Set<MultiKey<EventBean>>> flattenBatchJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinPostings)
          Flattens a list of pairs of join result sets.
static UniformPair<EventBean[]> flattenBatchStream(java.util.List<UniformPair<EventBean[]>> updateVector)
          Flatten the vector of arrays to an array.
static UniformPair<EventBean[]> flattenList(java.util.ArrayDeque<UniformPair<EventBean[]>> eventVector)
          Flatten the vector of arrays to an array.
static EventPropertyGetter getAssertPropertyGetter(EventType[] eventTypes, int keyStreamNum, java.lang.String property)
           
static EventPropertyGetter getAssertPropertyGetter(EventType type, java.lang.String propertyName)
           
static EventBean[] getDistinctByProp(java.util.ArrayDeque<EventBean> events, EventBeanReader reader)
          Returns the distinct events by properties.
static EventBean[] getDistinctByProp(EventBean[] events, EventBeanReader reader)
          Returns the distinct events by properties.
static MultiKeyUntyped getMultiKey(EventBean[] eventsPerStream, ExprEvaluator[] evaluators, ExprEvaluatorContext context, java.lang.Class[] coercionTypes)
           
static MultiKeyUntyped getMultiKey(EventBean theEvent, EventPropertyGetter[] propertyGetters)
          Returns Multikey instance for given event and getters.
static MultiKeyUntyped getMultiKey(EventBean theEvent, EventPropertyGetter[] propertyGetters, java.lang.Class[] coercionTypes)
           
static EventBean[] getNewDataNonRemoved(EventBean[] newData, java.util.HashSet<EventBean> removedEvents)
           
static EventBean[] getNewDataNonRemoved(EventBean[] newData, java.util.HashSet<EventBean> removedEvents, EventBean[][] newEventsPerView)
           
static EventBean getNonemptyFirstEvent(java.util.Collection<EventBean> matchingEvents)
           
static java.lang.Object getNonemptyFirstEventUnderlying(java.util.Collection<EventBean> matchingEvents)
           
static java.lang.Object[] getPropertyArray(EventBean[] eventsPerStream, EventPropertyGetter[] propertyGetters, int[] streamNums)
           
static java.lang.Object[] getPropertyArray(EventBean theEvent, EventPropertyGetter[] propertyGetters)
          Returns object array containing property values of given properties, retrieved via EventPropertyGetter instances.
static java.lang.String printEvent(EventBean theEvent)
          Format the event and return a string representation.
static java.lang.String printEvents(EventBean[] events)
           
static EventBean[] resizeArray(EventBean[] oldArray, int newSize)
          Resizes an array of events to a new size.
static void safeArrayCopy(EventBean[] eventsPerStream, EventBean[] eventsLambda)
           
static java.lang.String summarize(EventBean theEvent)
           
static java.lang.String summarize(EventBean[] events)
           
static void summarize(EventBean theEvent, java.io.StringWriter writer)
           
static java.lang.String summarizeUnderlying(java.lang.Object underlying)
           
static void summarizeUnderlying(java.lang.Object underlying, java.io.StringWriter writer)
           
static EventBean[] toArray(java.util.Collection<EventBean> eventList)
          Convert list of events to array, returning null for empty or null lists.
static java.lang.String toString(java.util.Map<java.lang.String,java.lang.Object> map)
          Renders a map of elements, in which elements can be events or event arrays interspersed with other objects,
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventBeanUtility

public EventBeanUtility()
Method Detail

allocatePerStreamShift

public static EventBean[] allocatePerStreamShift(EventBean[] eventsPerStream)

getNonemptyFirstEventUnderlying

public static java.lang.Object getNonemptyFirstEventUnderlying(java.util.Collection<EventBean> matchingEvents)

getNonemptyFirstEvent

public static EventBean getNonemptyFirstEvent(java.util.Collection<EventBean> matchingEvents)

getAssertPropertyGetter

public static EventPropertyGetter getAssertPropertyGetter(EventType type,
                                                          java.lang.String propertyName)

getAssertPropertyGetter

public static EventPropertyGetter getAssertPropertyGetter(EventType[] eventTypes,
                                                          int keyStreamNum,
                                                          java.lang.String property)

resizeArray

public static EventBean[] resizeArray(EventBean[] oldArray,
                                      int newSize)
Resizes an array of events to a new size.

Returns the same array reference if the size is the same.

Parameters:
oldArray - array to resize
newSize - new array size
Returns:
resized array

flattenList

public static UniformPair<EventBean[]> flattenList(java.util.ArrayDeque<UniformPair<EventBean[]>> eventVector)
Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.

Parameters:
eventVector - vector
Returns:
array with all events

flatten

public static EventBean[] flatten(java.util.ArrayDeque<EventBean[]> eventVector)
Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.

Parameters:
eventVector - vector
Returns:
array with all events

flattenBatchStream

public static UniformPair<EventBean[]> flattenBatchStream(java.util.List<UniformPair<EventBean[]>> updateVector)
Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.

Parameters:
updateVector - is a list of updates of old and new events
Returns:
array with all events

append

protected static EventBean[] append(EventBean[] source,
                                    EventBean[] append)
Append arrays.

Parameters:
source - array
append - array
Returns:
appended array

toArray

public static EventBean[] toArray(java.util.Collection<EventBean> eventList)
Convert list of events to array, returning null for empty or null lists.

Parameters:
eventList - is a list of events to convert
Returns:
array of events

getPropertyArray

public static java.lang.Object[] getPropertyArray(EventBean theEvent,
                                                  EventPropertyGetter[] propertyGetters)
Returns object array containing property values of given properties, retrieved via EventPropertyGetter instances.

Parameters:
theEvent - - event to get property values from
propertyGetters - - getters to use for getting property values
Returns:
object array with property values

getPropertyArray

public static java.lang.Object[] getPropertyArray(EventBean[] eventsPerStream,
                                                  EventPropertyGetter[] propertyGetters,
                                                  int[] streamNums)

getMultiKey

public static MultiKeyUntyped getMultiKey(EventBean theEvent,
                                          EventPropertyGetter[] propertyGetters)
Returns Multikey instance for given event and getters.

Parameters:
theEvent - - event to get property values from
propertyGetters - - getters for access to properties
Returns:
MultiKey with property values

getMultiKey

public static MultiKeyUntyped getMultiKey(EventBean theEvent,
                                          EventPropertyGetter[] propertyGetters,
                                          java.lang.Class[] coercionTypes)

getMultiKey

public static MultiKeyUntyped getMultiKey(EventBean[] eventsPerStream,
                                          ExprEvaluator[] evaluators,
                                          ExprEvaluatorContext context,
                                          java.lang.Class[] coercionTypes)

coerce

public static java.lang.Object coerce(java.lang.Object target,
                                      java.lang.Class coercionType)

printEvent

public static java.lang.String printEvent(EventBean theEvent)
Format the event and return a string representation.

Parameters:
theEvent - is the event to format.
Returns:
string representation of event

printEvents

public static java.lang.String printEvents(EventBean[] events)

appendEvent

public static void appendEvent(java.io.StringWriter writer,
                               EventBean theEvent)

flattenBatchJoin

public static UniformPair<java.util.Set<MultiKey<EventBean>>> flattenBatchJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinPostings)
Flattens a list of pairs of join result sets.

Parameters:
joinPostings - is the list
Returns:
is the consolidate sets

addToArray

public static EventBean[] addToArray(EventBean[] array,
                                     EventBean eventToAdd)
Expand the array passed in by the single element to add.

Parameters:
array - to expand
eventToAdd - element to add
Returns:
resized array

addToArray

public static EventBean[] addToArray(EventBean[] array,
                                     java.util.Collection<EventBean> eventsToAdd)
Expand the array passed in by the multiple elements to add.

Parameters:
array - to expand
eventsToAdd - elements to add
Returns:
resized array

createNativeFragmentType

public static FragmentEventType createNativeFragmentType(java.lang.Class propertyType,
                                                         java.lang.Class genericType,
                                                         EventAdapterService eventAdapterService)
Create a fragment event type.

Parameters:
propertyType - property return type
genericType - property generic type parameter, or null if none
eventAdapterService - for event types
Returns:
fragment type

getDistinctByProp

public static EventBean[] getDistinctByProp(java.util.ArrayDeque<EventBean> events,
                                            EventBeanReader reader)
Returns the distinct events by properties.

Parameters:
events - to inspect
reader - for retrieving properties
Returns:
distinct events

getDistinctByProp

public static EventBean[] getDistinctByProp(EventBean[] events,
                                            EventBeanReader reader)
Returns the distinct events by properties.

Parameters:
events - to inspect
reader - for retrieving properties
Returns:
distinct events

denaturalize

public static EventBean[] denaturalize(EventBean[] naturals)

compareReferences

public static boolean compareReferences(EventBean[] reference,
                                        EventBean[] eventsPerStream)

summarize

public static java.lang.String summarize(EventBean theEvent)

summarize

public static void summarize(EventBean theEvent,
                             java.io.StringWriter writer)

summarizeUnderlying

public static java.lang.String summarizeUnderlying(java.lang.Object underlying)

summarizeUnderlying

public static void summarizeUnderlying(java.lang.Object underlying,
                                       java.io.StringWriter writer)

summarize

public static java.lang.String summarize(EventBean[] events)

safeArrayCopy

public static void safeArrayCopy(EventBean[] eventsPerStream,
                                 EventBean[] eventsLambda)

getNewDataNonRemoved

public static EventBean[] getNewDataNonRemoved(EventBean[] newData,
                                               java.util.HashSet<EventBean> removedEvents)

getNewDataNonRemoved

public static EventBean[] getNewDataNonRemoved(EventBean[] newData,
                                               java.util.HashSet<EventBean> removedEvents,
                                               EventBean[][] newEventsPerView)

toString

public static java.lang.String toString(java.util.Map<java.lang.String,java.lang.Object> map)
Renders a map of elements, in which elements can be events or event arrays interspersed with other objects,

Parameters:
map - to render
Returns:
comma-separated list of map entry name-value pairs

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