blob: 9071dd39848707394ab4db28d14af21c85761c3f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 Thales Global Services S.A.S.
* 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:
* Thales Global Services S.A.S - initial API and implementation
******************************************************************************/
package org.eclipse.emf.ecoretools.explorer.contextual.queries;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.amalgam.explorer.contextual.core.query.IQuery;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EReference;
/**
* @author Boubekeur Zendagui
*/
public class EClassInheritedReferencesQuery implements IQuery {
@Override
public List<Object> compute(Object object_p) {
List<Object> result = new ArrayList<Object>();
if (object_p instanceof EClass)
{
EClass eClass = (EClass) object_p;
EList<EReference> eReferences = eClass.getEReferences();
EList<EReference> eAllReferences = eClass.getEAllReferences();
result.addAll(eAllReferences);
result.removeAll(eReferences);
}
return result;
}
}