当前位置: 首页>>代码示例>>Java>>正文


Java ContainerValue.addElement方法代码示例

本文整理汇总了Java中net.ssehub.easy.varModel.model.values.ContainerValue.addElement方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerValue.addElement方法的具体用法?Java ContainerValue.addElement怎么用?Java ContainerValue.addElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.ssehub.easy.varModel.model.values.ContainerValue的用法示例。


在下文中一共展示了ContainerValue.addElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleNextValue

import net.ssehub.easy.varModel.model.values.ContainerValue; //导入方法依赖的package包/类
/**
 * Handles the next value by checking whether it was already added.
 * 
 * @param value the value
 * @param result the result container to be changed if not already added
 * @param data the temporary data storing already added elements
 * @param nextValues the next values to be considered for iteration
 * @throws ValueDoesNotMatchTypeException if adding <code>value</code> to <code>result</code> is failing
 */
private void handleNextValue(Value value, ContainerValue result, Map<Object, Object> data, 
    List<Value> nextValues) throws ValueDoesNotMatchTypeException {
    @SuppressWarnings("unchecked")
    Set<Object> marking = (Set<Object>) data.get(DATA_CLOSURE_MARKED);
    if (null == marking) {
        marking = new HashSet<Object>();
        data.put(DATA_CLOSURE_MARKED, marking);
    }
    if (!marking.contains(value)) {
        nextValues.add(value);
        if (null != result) {
            result.addElement(value);
        }
        marking.add(value);
    } else {
        data.put(DATA_CLOSURE_CYCLIC, Boolean.TRUE);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:28,代码来源:ContainerIterators.java

示例2: postProcessResult

import net.ssehub.easy.varModel.model.values.ContainerValue; //导入方法依赖的package包/类
@Override
public void postProcessResult(EvaluationAccessor result, Map<Object, Object> data) 
    throws ValueDoesNotMatchTypeException {
    Value rVal = result.getValue();
    Object tmp = data.get(KEY_SORTED_BY);
    if (null != tmp && rVal instanceof ContainerValue) {
        ContainerValue container = (ContainerValue) rVal;
        @SuppressWarnings("unchecked")
        TreeMap<Value, List<Value>> keyMap = (TreeMap<Value, List<Value>>) tmp;
        for (List<Value> valList : keyMap.values()) {
            for (Value val: valList) {
                container.addElement(val);
            }
        }
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:17,代码来源:ContainerIterators.java

示例3: evaluate

import net.ssehub.easy.varModel.model.values.ContainerValue; //导入方法依赖的package包/类
@Override
public EvaluationAccessor evaluate(EvaluationAccessor operand, EvaluationAccessor[] arguments) {
    EvaluationAccessor result = null;
    if (1 == arguments.length) {
        Value oValue = operand.getValue();
        Value aValue = arguments[0].getValue();
        if (oValue instanceof ContainerValue && null != aValue) {
            ContainerValue cont = (ContainerValue) oValue;
            try {
                cont.addElement(aValue);
                result = ConstantAccessor.POOL.getInstance().bind(aValue, operand.getContext());
            } catch (ValueDoesNotMatchTypeException e) {
                // result -> null
                operand.getContext().addErrorMessage(e);
            }
        }
    }
    return result;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:20,代码来源:ContainerOperations.java


注:本文中的net.ssehub.easy.varModel.model.values.ContainerValue.addElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。