blob: c8d2d4cd24b1e8e23fbdf8443501a99c032dc60c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 IBM 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 Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.Arena;
import org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.HockeyleaguePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Arena</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.impl.ArenaImpl#getAddress <em>Address</em>}</li>
* <li>{@link org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.impl.ArenaImpl#getCapacity <em>Capacity</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ArenaImpl extends HockeyleagueObjectImpl implements Arena {
/**
* The default value of the '{@link #getAddress() <em>Address</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAddress()
* @generated
* @ordered
*/
protected static final String ADDRESS_EDEFAULT = null;
/**
* The cached value of the '{@link #getAddress() <em>Address</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAddress()
* @generated
* @ordered
*/
protected String address = ADDRESS_EDEFAULT;
/**
* The default value of the '{@link #getCapacity() <em>Capacity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCapacity()
* @generated
* @ordered
*/
protected static final int CAPACITY_EDEFAULT = 0;
/**
* The cached value of the '{@link #getCapacity() <em>Capacity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCapacity()
* @generated
* @ordered
*/
protected int capacity = CAPACITY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ArenaImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return HockeyleaguePackage.Literals.ARENA;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getAddress() {
return address;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAddress(String newAddress) {
String oldAddress = address;
address = newAddress;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, HockeyleaguePackage.ARENA__ADDRESS, oldAddress, address));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getCapacity() {
return capacity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCapacity(int newCapacity) {
int oldCapacity = capacity;
capacity = newCapacity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, HockeyleaguePackage.ARENA__CAPACITY, oldCapacity, capacity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case HockeyleaguePackage.ARENA__ADDRESS:
return getAddress();
case HockeyleaguePackage.ARENA__CAPACITY:
return new Integer(getCapacity());
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case HockeyleaguePackage.ARENA__ADDRESS:
setAddress((String)newValue);
return;
case HockeyleaguePackage.ARENA__CAPACITY:
setCapacity(((Integer)newValue).intValue());
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case HockeyleaguePackage.ARENA__ADDRESS:
setAddress(ADDRESS_EDEFAULT);
return;
case HockeyleaguePackage.ARENA__CAPACITY:
setCapacity(CAPACITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case HockeyleaguePackage.ARENA__ADDRESS:
return ADDRESS_EDEFAULT == null ? address != null : !ADDRESS_EDEFAULT.equals(address);
case HockeyleaguePackage.ARENA__CAPACITY:
return capacity != CAPACITY_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (address: "); //$NON-NLS-1$
result.append(address);
result.append(", capacity: "); //$NON-NLS-1$
result.append(capacity);
result.append(')');
return result.toString();
}
} //ArenaImpl