本文整理匯總了Java中com.espertech.esper.collection.MultiKeyUntyped.getKeys方法的典型用法代碼示例。如果您正苦於以下問題:Java MultiKeyUntyped.getKeys方法的具體用法?Java MultiKeyUntyped.getKeys怎麽用?Java MultiKeyUntyped.getKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.espertech.esper.collection.MultiKeyUntyped
的用法示例。
在下文中一共展示了MultiKeyUntyped.getKeys方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addProperty
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
/**
* Add a property to the event passed in.
*
* @param originalEvent - event to add property to
* @param propertyNames - names of properties to add
* @param propertyValues - value of properties to add
* @param targetEventType - new event type
* @param eventAdapterService - service for generating events and handling event types
* @return event with added property
*/
protected static EventBean addProperty(EventBean originalEvent,
String[] propertyNames,
Object propertyValues,
EventType targetEventType,
EventAdapterService eventAdapterService) {
Map<String, Object> values = new HashMap<String, Object>();
if (propertyValues instanceof MultiKeyUntyped) {
MultiKeyUntyped props = (MultiKeyUntyped) propertyValues;
Object[] propertyValuesArr = props.getKeys();
for (int i = 0; i < propertyNames.length; i++) {
values.put(propertyNames[i], propertyValuesArr[i]);
}
} else {
values.put(propertyNames[0], propertyValues);
}
return eventAdapterService.adapterForTypedWrapper(originalEvent, values, targetEventType);
}
示例2: computeSubkey
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public Object computeSubkey(Object groupKey) {
if (isAggregationTop()) {
return null;
}
if (groupKey instanceof MultiKeyUntyped) {
MultiKeyUntyped mk = (MultiKeyUntyped) groupKey;
Object[] keys = mk.getKeys();
if (rollupKeys.length == keys.length) {
return mk;
} else if (rollupKeys.length == 1) {
return keys[rollupKeys[0]];
} else {
Object[] subkeys = new Object[rollupKeys.length];
int count = 0;
for (int rollupKey : rollupKeys) {
subkeys[count++] = keys[rollupKey];
}
return new MultiKeyUntyped(subkeys);
}
} else {
return groupKey;
}
}
示例3: put
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void put(Object filterConstant, EventEvaluator evaluator) {
// Store evaluator keyed to set of values
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// make sure to remove the old evaluator for this constant
EventEvaluator oldEvaluator = evaluatorsMap.put(keys, evaluator);
// Store each value to match against in Map with it's evaluator as a list
Object[] keyValues = keys.getKeys();
for (int i = 0; i < keyValues.length; i++) {
List<EventEvaluator> evaluators = constantsMap.get(keyValues[i]);
if (evaluators == null) {
evaluators = new LinkedList<EventEvaluator>();
constantsMap.put(keyValues[i], evaluators);
} else {
if (oldEvaluator != null) {
evaluators.remove(oldEvaluator);
}
}
evaluators.add(evaluator);
}
}
示例4: remove
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void remove(Object filterConstant) {
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// remove the mapping of value set to evaluator
EventEvaluator eval = evaluatorsMap.remove(keys);
Object[] keyValues = keys.getKeys();
for (int i = 0; i < keyValues.length; i++) {
List<EventEvaluator> evaluators = constantsMap.get(keyValues[i]);
if (evaluators != null) {
// could be removed already as same-value constants existed
evaluators.remove(eval);
if (evaluators.isEmpty()) {
constantsMap.remove(keyValues[i]);
}
}
}
}
示例5: put
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void put(Object filterConstant, EventEvaluator evaluator) {
// Store evaluator keyed to set of values
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
filterValueEvaluators.put(keys, evaluator);
evaluatorsSet.add(evaluator);
// Store each value to match against in Map with it's evaluator as a list
Object[] keyValues = keys.getKeys();
for (Object keyValue : keyValues) {
Set<EventEvaluator> evaluators = constantsMap.get(keyValue);
if (evaluators == null) {
evaluators = new HashSet<EventEvaluator>();
constantsMap.put(keyValue, evaluators);
}
evaluators.add(evaluator);
}
}
示例6: remove
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void remove(Object filterConstant) {
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// remove the mapping of value set to evaluator
EventEvaluator eval = filterValueEvaluators.remove(keys);
evaluatorsSet.remove(eval);
Object[] keyValues = keys.getKeys();
for (Object keyValue : keyValues) {
Set<EventEvaluator> evaluators = constantsMap.get(keyValue);
if (evaluators != null) {
// could already be removed as constants may be the same
evaluators.remove(eval);
if (evaluators.isEmpty()) {
constantsMap.remove(keyValue);
}
}
}
}
示例7: addProperty
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
/**
* Add a property to the event passed in.
* @param originalEvent - event to add property to
* @param propertyNames - names of properties to add
* @param propertyValues - value of properties to add
* @param targetEventType - new event type
* @param eventAdapterService - service for generating events and handling event types
* @return event with added property
*/
protected static EventBean addProperty(EventBean originalEvent,
String[] propertyNames,
Object propertyValues,
EventType targetEventType,
EventAdapterService eventAdapterService)
{
Map<String, Object> values = new HashMap<String, Object>();
if (propertyValues instanceof MultiKeyUntyped) {
MultiKeyUntyped props = (MultiKeyUntyped) propertyValues;
Object[] propertyValuesArr = props.getKeys();
for (int i = 0; i < propertyNames.length; i++)
{
values.put(propertyNames[i], propertyValuesArr[i]);
}
}
else {
values.put(propertyNames[0], propertyValues);
}
return eventAdapterService.adapterForTypedWrapper(originalEvent, values, targetEventType);
}
示例8: put
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void put(Object filterConstant, EventEvaluator evaluator)
{
// Store evaluator keyed to set of values
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
filterValueEvaluators.put(keys, evaluator);
evaluatorsSet.add(evaluator);
// Store each value to match against in Map with it's evaluator as a list
Object[] keyValues = keys.getKeys();
for (Object keyValue : keyValues)
{
Set<EventEvaluator> evaluators = constantsMap.get(keyValue);
if (evaluators == null)
{
evaluators = new HashSet<EventEvaluator>();
constantsMap.put(keyValue, evaluators);
}
evaluators.add(evaluator);
}
}
示例9: get
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public Object get(EventBean eventBean) throws PropertyAccessException {
RevisionEventBeanDeclared riv = (RevisionEventBeanDeclared) eventBean;
MultiKeyUntyped key = (MultiKeyUntyped) riv.getKey();
if (key == null) {
return null;
}
return key.getKeys()[keyPropertyNumber];
}
示例10: put
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final void put(Object filterConstant, EventEvaluator evaluator)
{
// Store evaluator keyed to set of values
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// make sure to remove the old evaluator for this constant
EventEvaluator oldEvaluator = evaluatorsMap.put(keys, evaluator);
// Store each value to match against in Map with it's evaluator as a list
Object[] keyValues = keys.getKeys();
for (int i = 0; i < keyValues.length; i++)
{
List<EventEvaluator> evaluators = constantsMap.get(keyValues[i]);
if (evaluators == null)
{
evaluators = new LinkedList<EventEvaluator>();
constantsMap.put(keyValues[i], evaluators);
}
else
{
if (oldEvaluator != null)
{
evaluators.remove(oldEvaluator);
}
}
evaluators.add(evaluator);
}
}
示例11: remove
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final boolean remove(Object filterConstant)
{
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// remove the mapping of value set to evaluator
EventEvaluator eval = evaluatorsMap.remove(keys);
boolean isRemoved = false;
if (eval != null)
{
isRemoved = true;
}
Object[] keyValues = keys.getKeys();
for (int i = 0; i < keyValues.length; i++)
{
List<EventEvaluator> evaluators = constantsMap.get(keyValues[i]);
if (evaluators != null) // could be removed already as same-value constants existed
{
evaluators.remove(eval);
if (evaluators.isEmpty())
{
constantsMap.remove(keyValues[i]);
}
}
}
return isRemoved;
}
示例12: remove
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public final boolean remove(Object filterConstant)
{
MultiKeyUntyped keys = (MultiKeyUntyped) filterConstant;
// remove the mapping of value set to evaluator
EventEvaluator eval = filterValueEvaluators.remove(keys);
evaluatorsSet.remove(eval);
boolean isRemoved = false;
if (eval != null)
{
isRemoved = true;
}
Object[] keyValues = keys.getKeys();
for (Object keyValue : keyValues)
{
Set<EventEvaluator> evaluators = constantsMap.get(keyValue);
if (evaluators != null) // could already be removed as constants may be the same
{
evaluators.remove(eval);
if (evaluators.isEmpty())
{
constantsMap.remove(keyValue);
}
}
}
return isRemoved;
}
示例13: get
import com.espertech.esper.collection.MultiKeyUntyped; //導入方法依賴的package包/類
public Object get(EventBean eventBean) throws PropertyAccessException {
RevisionEventBeanMerge riv = (RevisionEventBeanMerge) eventBean;
MultiKeyUntyped mk = (MultiKeyUntyped) riv.getKey();
return mk.getKeys()[keyPropertyNumber];
}