本文整理汇总了Java中com.espertech.esper.event.EventBeanUtility.coerce方法的典型用法代码示例。如果您正苦于以下问题:Java EventBeanUtility.coerce方法的具体用法?Java EventBeanUtility.coerce怎么用?Java EventBeanUtility.coerce使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.event.EventBeanUtility
的用法示例。
在下文中一共展示了EventBeanUtility.coerce方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
Object comparableStart = super.evaluateLookupStart(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparableStart);
}
if (comparableStart == null) {
return null;
}
Object comparableEnd = super.evaluateLookupEnd(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparableEnd);
}
if (comparableEnd == null) {
return null;
}
comparableStart = EventBeanUtility.coerce(comparableStart, coercionType);
comparableEnd = EventBeanUtility.coerce(comparableEnd, coercionType);
TreeMap index = (TreeMap) parent;
SortedMap<Object, Set<EventBean>> submapOne = index.headMap(comparableStart, !includeStart);
SortedMap<Object, Set<EventBean>> submapTwo = index.tailMap(comparableEnd, !includeEnd);
return CompositeIndexQueryRange.handle(theEvent, submapOne, submapTwo, result, next, postProcessor);
}
示例2: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
Object comparableStart = super.evaluateLookupStart(theEvent, context);
if (comparableStart == null) {
return null;
}
Object comparableEnd = super.evaluateLookupEnd(theEvent, context);
if (comparableEnd == null) {
return null;
}
comparableStart = EventBeanUtility.coerce(comparableStart, coercionType);
comparableEnd = EventBeanUtility.coerce(comparableEnd, coercionType);
TreeMap index = (TreeMap) parent;
SortedMap<Object,Set<EventBean>> submapOne = index.headMap(comparableStart, !includeStart);
SortedMap<Object,Set<EventBean>> submapTwo = index.tailMap(comparableEnd, !includeEnd);
return CompositeIndexQueryRange.handle(theEvent, submapOne, submapTwo, result, next);
}
示例3: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparable);
}
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.headMap(comparable, true), null, result, next, postProcessor);
}
示例4: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparable);
}
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.headMap(comparable), null, result, next, postProcessor);
}
示例5: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparable);
}
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.tailMap(comparable, false), null, result, next, postProcessor);
}
示例6: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
Object comparableStart = super.evaluateLookupStart(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparableStart);
}
if (comparableStart == null) {
return null;
}
Object comparableEnd = super.evaluateLookupEnd(theEvent, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparableEnd);
}
if (comparableEnd == null) {
return null;
}
TreeMap index = (TreeMap) parent;
comparableStart = EventBeanUtility.coerce(comparableStart, coercionType);
comparableEnd = EventBeanUtility.coerce(comparableEnd, coercionType);
SortedMap<Object, Set<EventBean>> submap;
try {
submap = index.subMap(comparableStart, includeStart, comparableEnd, includeEnd);
} catch (IllegalArgumentException ex) {
if (allowReverseRange) {
submap = index.subMap(comparableEnd, includeStart, comparableStart, includeEnd);
} else {
return null;
}
}
return CompositeIndexQueryRange.handle(theEvent, submap, null, result, next, postProcessor);
}
示例7: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Collection<EventBean> lookup(EventBean[] eventPerStream, Map parent, Collection<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, ArrayList<Object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluatePerStream(eventPerStream, context);
if (optionalKeyCollector != null) {
optionalKeyCollector.add(comparable);
}
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(eventPerStream, index.tailMap(comparable), null, result, next, postProcessor);
}
示例8: enter
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public void enter(EventBean theEvent, Map parent) {
Object sortable = propertyGetter.get(theEvent);
if (sortable == null) {
if (nullKeys == null) {
nullKeys = new HashSet<EventBean>();
}
nullKeys.add(theEvent);
return;
}
sortable = EventBeanUtility.coerce(sortable, coercionType);
// if this is a leaf, enter event
if (next == null) {
Map<Object, Set<EventBean>> eventMap = (Map<Object, Set<EventBean>>) parent;
Set<EventBean> events = eventMap.get(sortable);
if (events == null) {
events = new HashSet<EventBean>();
eventMap.put(sortable, events);
}
events.add(theEvent);
} else {
Map innerIndex = (Map) parent.get(sortable);
if (innerIndex == null) {
innerIndex = new TreeMap();
parent.put(sortable, innerIndex);
}
next.enter(theEvent, innerIndex);
}
}
示例9: getKey
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
protected Object getKey(EventBean theEvent) {
Object keyValue = super.getKey(theEvent);
if ((keyValue != null) && (!keyValue.getClass().equals(coercionType))) {
if (keyValue instanceof Number) {
keyValue = coercer.coerceBoxed((Number) keyValue);
} else {
keyValue = EventBeanUtility.coerce(keyValue, coercionType);
}
}
return keyValue;
}
示例10: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.headMap(comparable, true), null, result, next);
}
示例11: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.headMap(comparable), null, result, next);
}
示例12: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
TreeMap index = (TreeMap) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.tailMap(comparable, false), null, result, next);
}
示例13: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
Object comparableStart = super.evaluateLookupStart(theEvent, context);
if (comparableStart == null) {
return null;
}
Object comparableEnd = super.evaluateLookupEnd(theEvent, context);
if (comparableEnd == null) {
return null;
}
TreeMap index = (TreeMap) parent;
comparableStart = EventBeanUtility.coerce(comparableStart, coercionType);
comparableEnd = EventBeanUtility.coerce(comparableEnd, coercionType);
SortedMap<Object,Set<EventBean>> submap;
try {
submap = index.subMap(comparableStart, includeStart, comparableEnd, includeEnd);
}
catch (IllegalArgumentException ex) {
if (allowReverseRange) {
submap = index.subMap(comparableEnd, includeStart, comparableStart, includeEnd);
}
else {
return null;
}
}
return CompositeIndexQueryRange.handle(theEvent, submap, null, result, next);
}
示例14: lookup
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public Set<EventBean> lookup(EventBean theEvent, Map parent, Set<EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context) {
TreeMap<Object, ?> index = (TreeMap<Object, ?>) parent;
Object comparable = super.evaluateLookup(theEvent, context);
if (comparable == null) {
return null;
}
comparable = EventBeanUtility.coerce(comparable, coercionType);
return CompositeIndexQueryRange.handle(theEvent, index.tailMap(comparable), null, result, next);
}
示例15: enter
import com.espertech.esper.event.EventBeanUtility; //导入方法依赖的package包/类
public void enter(EventBean theEvent, Map parent) {
Object sortable = propertyGetter.get(theEvent);
if (sortable == null) {
if (nullKeys == null) {
nullKeys = new HashSet<EventBean>();
}
nullKeys.add(theEvent);
return;
}
sortable = EventBeanUtility.coerce(sortable, coercionType);
// if this is a leaf, enter event
if (next == null) {
Map<Object, Set<EventBean>> eventMap = (Map<Object, Set<EventBean>>) parent;
Set<EventBean> events = eventMap.get(sortable);
if (events == null)
{
events = new HashSet<EventBean>();
eventMap.put(sortable, events);
}
events.add(theEvent);
}
else {
Map innerIndex = (Map) parent.get(sortable);
if (innerIndex == null) {
innerIndex = new TreeMap();
parent.put(sortable, innerIndex);
}
next.enter(theEvent, innerIndex);
}
}