org.eclipse.ocl.internal.evaluation.IterationTemplateReject Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2005, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
*
*
*
* $Id: IterationTemplateReject.java,v 1.5 2010/02/03 19:54:13 ewillink Exp $
*/
package org.eclipse.ocl.internal.evaluation;
import java.util.Collection;
import java.util.List;
import org.eclipse.ocl.EvaluationEnvironment;
import org.eclipse.ocl.EvaluationVisitor;
import org.eclipse.ocl.expressions.Variable;
/**
*
*/
public class IterationTemplateReject
extends IterationTemplate {
private IterationTemplateReject(
EvaluationVisitor v) {
super(v);
}
public static
IterationTemplate getInstance(
EvaluationVisitor v) {
return new IterationTemplateReject(v);
}
@Override
protected Object evaluateResult(List> iterators, String resultName, Object body) {
EvaluationEnvironment env = getEvalEnvironment();
// should be exactly one iterator
String iterName = iterators.get(0).getName();
Object currObj = env.getValueOf(iterName);
@SuppressWarnings("unchecked")
Collection