當前位置: 首頁>>代碼示例>>Java>>正文


Java MultiKeyUntyped.getKeys方法代碼示例

本文整理匯總了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);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:30,代碼來源:AddPropertyValueOptionalView.java

示例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;
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:24,代碼來源:AggregationGroupByRollupLevel.java

示例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);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:23,代碼來源:FilterParamIndexIn.java

示例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]);
            }
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:19,代碼來源:FilterParamIndexIn.java

示例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);
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:18,代碼來源:FilterParamIndexNotIn.java

示例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);
            }
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:20,代碼來源:FilterParamIndexNotIn.java

示例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);
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:32,代碼來源:AddPropertyValueView.java

示例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);
    }
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:21,代碼來源:FilterParamIndexNotIn.java

示例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];
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:9,代碼來源:VAERevisionEventPropertyGetterDeclaredNKey.java

示例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);
    }
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:29,代碼來源:FilterParamIndexIn.java

示例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;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:28,代碼來源:FilterParamIndexIn.java

示例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;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:29,代碼來源:FilterParamIndexNotIn.java

示例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];
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:6,代碼來源:VAERevisionEventPropertyGetterMergeNKey.java


注:本文中的com.espertech.esper.collection.MultiKeyUntyped.getKeys方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。