com.espertech.esper.event.vaevent
Class PropertyUtility

java.lang.Object
  extended by com.espertech.esper.event.vaevent.PropertyUtility

public class PropertyUtility
extends Object

Utility for handling properties for the purpose of merging and versioning by revision event types.


Constructor Summary
PropertyUtility()
           
 
Method Summary
static PropertyGroupDesc[] analyzeGroups(String[] allProperties, EventType[] deltaEventTypes, String[] aliases)
          Analyze multiple event types and determine common property sets that form property groups.
protected static String[] copyAndSort(String[] input)
          Copy an sort the input array.
protected static EventPropertyGetter[] getGetters(EventType eventType, String[] propertyNames)
          Return getters for property names.
static Map<String,int[]> getGroupsPerProperty(PropertyGroupDesc[] groups)
          From a list of property groups that include multiple group numbers for each property, make a map of group numbers per property.
static MultiKeyUntyped getKeys(EventBean event, EventPropertyGetter[] keyPropertyGetters)
          Returns a multi-key for an event and key property getters
static Map<EventType,RevisionTypeDesc> getPerType(PropertyGroupDesc[] groups, String[] changesetProperties, String[] keyProperties)
          From a list of property groups that include contributing event types, build a map of contributing event types and their type descriptor.
static void removePropNamePostfixes(String[] propertyNames)
          Remove the postfixes for indexed and mapped properties that provide a clue that a property requires a index or map key parameter to return values, changing the array elements.
protected static String[] uniqueExclusiveSort(String[] values, String[] removeValues)
          Remove from values all removeValues and build a unique sorted result array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtility

public PropertyUtility()
Method Detail

removePropNamePostfixes

public static void removePropNamePostfixes(String[] propertyNames)
Remove the postfixes for indexed and mapped properties that provide a clue that a property requires a index or map key parameter to return values, changing the array elements.

Parameters:
propertyNames - to remove prefix for

getKeys

public static MultiKeyUntyped getKeys(EventBean event,
                                      EventPropertyGetter[] keyPropertyGetters)
Returns a multi-key for an event and key property getters

Parameters:
event - to get keys for
keyPropertyGetters - getters to use
Returns:
key

getPerType

public static Map<EventType,RevisionTypeDesc> getPerType(PropertyGroupDesc[] groups,
                                                         String[] changesetProperties,
                                                         String[] keyProperties)
From a list of property groups that include contributing event types, build a map of contributing event types and their type descriptor.

Parameters:
groups - property groups
changesetProperties - properties that change between groups
keyProperties - key properties
Returns:
map of event type and type information

getGroupsPerProperty

public static Map<String,int[]> getGroupsPerProperty(PropertyGroupDesc[] groups)
From a list of property groups that include multiple group numbers for each property, make a map of group numbers per property.

Parameters:
groups - property groups
Returns:
map of property name and group number

analyzeGroups

public static PropertyGroupDesc[] analyzeGroups(String[] allProperties,
                                                EventType[] deltaEventTypes,
                                                String[] aliases)
Analyze multiple event types and determine common property sets that form property groups.

Parameters:
allProperties - property names to look at
deltaEventTypes - all types contributing
aliases - names of properies
Returns:
groups

copyAndSort

protected static String[] copyAndSort(String[] input)
Copy an sort the input array.

Parameters:
input - to sort
Returns:
sorted copied array

getGetters

protected static EventPropertyGetter[] getGetters(EventType eventType,
                                                  String[] propertyNames)
Return getters for property names.

Parameters:
eventType - type to get getters from
propertyNames - names to get
Returns:
getters

uniqueExclusiveSort

protected static String[] uniqueExclusiveSort(String[] values,
                                              String[] removeValues)
Remove from values all removeValues and build a unique sorted result array.

Parameters:
values - to consider
removeValues - values to remove from values
Returns:
sorted unique

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com