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

org.w3.rdf.impl.RestImpl Maven / Gradle / Ivy

/*
 * Copyright (c) 2012 - 2024 Data In Motion and others.
 * All rights reserved. 
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.w3.rdf.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.w3.rdf.RDFList;
import org.w3.rdf.RdfPackage;
import org.w3.rdf.Rest;

/**
 * 
 * An implementation of the model object 'Rest'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.w3.rdf.impl.RestImpl#getParent Parent}
  • *
* * @generated */ public class RestImpl extends RDFListImpl implements Rest { /** * The cached value of the '{@link #getParent() Parent}' reference. * * * @see #getParent() * @generated * @ordered */ protected RDFList parent; /** * * * @generated */ protected RestImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return RdfPackage.Literals.REST; } /** * * * @generated */ @Override public RDFList getParent() { if (parent != null && parent.eIsProxy()) { InternalEObject oldParent = (InternalEObject)parent; parent = (RDFList)eResolveProxy(oldParent); if (parent != oldParent) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, RdfPackage.REST__PARENT, oldParent, parent)); } } return parent; } /** * * * @generated */ public RDFList basicGetParent() { return parent; } /** * * * @generated */ public NotificationChain basicSetParent(RDFList newParent, NotificationChain msgs) { RDFList oldParent = parent; parent = newParent; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RdfPackage.REST__PARENT, oldParent, newParent); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setParent(RDFList newParent) { if (newParent != parent) { NotificationChain msgs = null; if (parent != null) msgs = ((InternalEObject)parent).eInverseRemove(this, RdfPackage.RDF_LIST__REST, RDFList.class, msgs); if (newParent != null) msgs = ((InternalEObject)newParent).eInverseAdd(this, RdfPackage.RDF_LIST__REST, RDFList.class, msgs); msgs = basicSetParent(newParent, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdfPackage.REST__PARENT, newParent, newParent)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RdfPackage.REST__PARENT: if (parent != null) msgs = ((InternalEObject)parent).eInverseRemove(this, RdfPackage.RDF_LIST__REST, RDFList.class, msgs); return basicSetParent((RDFList)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RdfPackage.REST__PARENT: return basicSetParent(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case RdfPackage.REST__PARENT: if (resolve) return getParent(); return basicGetParent(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case RdfPackage.REST__PARENT: setParent((RDFList)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case RdfPackage.REST__PARENT: setParent((RDFList)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case RdfPackage.REST__PARENT: return parent != null; } return super.eIsSet(featureID); } } //RestImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy