All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ocl.uml.QueryImpl Maven / Gradle / Ivy

There is a newer version: 5.0.0-v20140520-1401
Show newest version
/**
 * 
 *
 * Copyright (c) 2007, 2009 IBM Corporation, Borland Software 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
 *   Radek Dvorak - Bug 261128
 *
 * 
 *
 * $Id: QueryImpl.java,v 1.2 2009/01/31 19:46:52 cdamus Exp $
 */

package org.eclipse.ocl.uml;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.ocl.EvaluationEnvironment;
import org.eclipse.ocl.Query;
import org.eclipse.ocl.util.OCLUtil;
import org.eclipse.ocl.util.ProblemAware;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Classifier;


/**
 * Implementation of the {@link OCL.Query} convenience interface.
 * 
 * @author Christian W. Damus (cdamus)
 */
class QueryImpl implements OCL.Query, ProblemAware {
    private final Query delegate;
    private final OCL ocl;
    
    QueryImpl(Query delegate, OCL ocl) {
        this.delegate = delegate;
        this.ocl = ocl;
    }

    public OCL getOCL() {
    	return ocl;
    }
    
	public boolean check(List objects) {
		return delegate.check(objects);
	}

	public boolean check(Object obj) {
		return delegate.check(obj);
	}

	public Object evaluate() {
		return delegate.evaluate();
	}

	public List evaluate(List objects) {
		return delegate.evaluate(objects);
	}

	public Object evaluate(Object obj) {
		return delegate.evaluate(obj);
	}

	public EvaluationEnvironment getEvaluationEnvironment() {
		return delegate.getEvaluationEnvironment();
	}

	public OCLExpression getExpression() {
		return (OCLExpression) delegate.getExpression();
	}

	public Map> getExtentMap() {
		return delegate.getExtentMap();
	}

	public String queryText() {
		return delegate.queryText();
	}

	public  List reject(List objects) {
		return delegate.reject(objects);
	}

	public Classifier resultType() {
		return delegate.resultType();
	}

	public  List select(List objects) {
		return delegate.select(objects);
	}

	public Diagnostic getProblems() {
		return OCLUtil.getEvaluationProblems(delegate);
	}	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy