blob: 290135e2e7f8a021bbfd3e8fecf595a312c138a6 [file] [log] [blame]
/*
* Copyright (c) 2005, 2011 IBM Corporation, CEA, 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
* Kenn Hussey (CEA) - 327039
*
* $Id: DurationIntervalImpl.java,v 1.16 2007/04/25 17:47:01 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.uml2.uml.Duration;
import org.eclipse.uml2.uml.DurationInterval;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.ValueSpecification;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Duration Interval</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DurationIntervalImpl#getMax <em>Max</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.DurationIntervalImpl#getMin <em>Min</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DurationIntervalImpl
extends IntervalImpl
implements DurationInterval {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DurationIntervalImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLPackage.Literals.DURATION_INTERVAL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ValueSpecification getMin() {
if (min != null && min.eIsProxy()) {
InternalEObject oldMin = (InternalEObject) min;
min = (ValueSpecification) eResolveProxy(oldMin);
if (min != oldMin) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.DURATION_INTERVAL__MIN, oldMin, min));
}
}
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ValueSpecification basicGetMin() {
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMinGen(ValueSpecification newMin) {
ValueSpecification oldMin = min;
min = newMin;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DURATION_INTERVAL__MIN, oldMin, min));
}
@Override
public void setMin(ValueSpecification newMin) {
if (newMin != null && !(newMin instanceof Duration)) {
throw new IllegalArgumentException(newMin.toString());
}
setMinGen(newMin);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetMin() {
return min != null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ValueSpecification getMax() {
if (max != null && max.eIsProxy()) {
InternalEObject oldMax = (InternalEObject) max;
max = (ValueSpecification) eResolveProxy(oldMax);
if (max != oldMax) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.DURATION_INTERVAL__MAX, oldMax, max));
}
}
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ValueSpecification basicGetMax() {
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMaxGen(ValueSpecification newMax) {
ValueSpecification oldMax = max;
max = newMax;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.DURATION_INTERVAL__MAX, oldMax, max));
}
@Override
public void setMax(ValueSpecification newMax) {
if (newMax != null && !(newMax instanceof Duration)) {
throw new IllegalArgumentException(newMax.toString());
}
setMaxGen(newMax);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetMax() {
return max != null;
}
} //DurationIntervalImpl