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

org.eclipse.ocl.expressions.impl.TupleLiteralExpImpl Maven / Gradle / Ivy

/**
 * 
 * 
 * Copyright (c) 2006, 2009 IBM Corporation, Zeligsoft Inc., 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
 *   Zeligsoft - Bug 207365
 * 
 * 
 *
 * $Id: TupleLiteralExpImpl.java,v 1.8 2009/01/23 17:16:03 cdamus Exp $
 */
package org.eclipse.ocl.expressions.impl;

import java.util.Collection;

import java.util.Map;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.expressions.TupleLiteralExp;
import org.eclipse.ocl.expressions.TupleLiteralPart;
import org.eclipse.ocl.expressions.operations.TupleLiteralExpOperations;
import org.eclipse.ocl.utilities.Visitor;

/**
 * 
 * An implementation of the model object 'Tuple Literal Exp'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.eclipse.ocl.expressions.impl.TupleLiteralExpImpl#getPart Part}
  • *
*

* * @generated */ public class TupleLiteralExpImpl extends LiteralExpImpl implements TupleLiteralExp { /** * The cached value of the '{@link #getPart() Part}' containment reference list. * * * @see #getPart() * @generated * @ordered */ protected EList> part; /** * * * @generated */ protected TupleLiteralExpImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return ExpressionsPackage.Literals.TUPLE_LITERAL_EXP; } /** * * * @generated */ public EList> getPart() { if (part == null) { part = new EObjectContainmentEList>( TupleLiteralPart.class, this, ExpressionsPackage.TUPLE_LITERAL_EXP__PART); } return part; } /** * * * @generated */ public boolean checkTupleType(DiagnosticChain diagnostics, Map context) { return TupleLiteralExpOperations.checkTupleType(this, diagnostics, context); } /** * * * @generated */ public boolean checkPartsUnique(DiagnosticChain diagnostics, Map context) { return TupleLiteralExpOperations.checkPartsUnique(this, diagnostics, context); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ExpressionsPackage.TUPLE_LITERAL_EXP__PART : return ((InternalEList) getPart()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ExpressionsPackage.TUPLE_LITERAL_EXP__PART : return getPart(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ExpressionsPackage.TUPLE_LITERAL_EXP__PART : getPart().clear(); getPart().addAll( (Collection>) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ExpressionsPackage.TUPLE_LITERAL_EXP__PART : getPart().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ExpressionsPackage.TUPLE_LITERAL_EXP__PART : return part != null && !part.isEmpty(); } return super.eIsSet(featureID); } /** * @generated NOT */ @Override @SuppressWarnings("unchecked") public > T accept(U v) { return ((Visitor) v) .visitTupleLiteralExp(this); } } //TupleLiteralExpImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy