/**
*
*
*
* $Id$
*/
package net.opengis.ows11.impl;
import java.util.Collection;
import net.opengis.ows11.AddressType;
import net.opengis.ows11.Ows11Package;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
/**
*
* An implementation of the model object 'Address Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getDeliveryPoint Delivery Point}
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getCity City}
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getAdministrativeArea Administrative Area}
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getPostalCode Postal Code}
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getCountry Country}
* - {@link net.opengis.ows11.impl.AddressTypeImpl#getElectronicMailAddress Electronic Mail Address}
*
*
*
* @generated
*/
public class AddressTypeImpl extends EObjectImpl implements AddressType {
/**
* The cached value of the '{@link #getDeliveryPoint() Delivery Point}' attribute list.
*
*
* @see #getDeliveryPoint()
* @generated
* @ordered
*/
protected EList deliveryPoint;
/**
* The default value of the '{@link #getCity() City}' attribute.
*
*
* @see #getCity()
* @generated
* @ordered
*/
protected static final String CITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getCity() City}' attribute.
*
*
* @see #getCity()
* @generated
* @ordered
*/
protected String city = CITY_EDEFAULT;
/**
* The default value of the '{@link #getAdministrativeArea() Administrative Area}' attribute.
*
*
* @see #getAdministrativeArea()
* @generated
* @ordered
*/
protected static final String ADMINISTRATIVE_AREA_EDEFAULT = null;
/**
* The cached value of the '{@link #getAdministrativeArea() Administrative Area}' attribute.
*
*
* @see #getAdministrativeArea()
* @generated
* @ordered
*/
protected String administrativeArea = ADMINISTRATIVE_AREA_EDEFAULT;
/**
* The default value of the '{@link #getPostalCode() Postal Code}' attribute.
*
*
* @see #getPostalCode()
* @generated
* @ordered
*/
protected static final String POSTAL_CODE_EDEFAULT = null;
/**
* The cached value of the '{@link #getPostalCode() Postal Code}' attribute.
*
*
* @see #getPostalCode()
* @generated
* @ordered
*/
protected String postalCode = POSTAL_CODE_EDEFAULT;
/**
* The default value of the '{@link #getCountry() Country}' attribute.
*
*
* @see #getCountry()
* @generated
* @ordered
*/
protected static final String COUNTRY_EDEFAULT = null;
/**
* The cached value of the '{@link #getCountry() Country}' attribute.
*
*
* @see #getCountry()
* @generated
* @ordered
*/
protected String country = COUNTRY_EDEFAULT;
/**
* The cached value of the '{@link #getElectronicMailAddress() Electronic Mail Address}' attribute list.
*
*
* @see #getElectronicMailAddress()
* @generated
* @ordered
*/
protected EList electronicMailAddress;
/**
*
*
* @generated
*/
protected AddressTypeImpl() {
super();
}
/**
*
*
* @generated
*/
protected EClass eStaticClass() {
return Ows11Package.Literals.ADDRESS_TYPE;
}
/**
*
*
* @generated
*/
public EList getDeliveryPoint() {
if (deliveryPoint == null) {
deliveryPoint = new EDataTypeEList(String.class, this, Ows11Package.ADDRESS_TYPE__DELIVERY_POINT);
}
return deliveryPoint;
}
/**
*
*
* @generated
*/
public String getCity() {
return city;
}
/**
*
*
* @generated
*/
public void setCity(String newCity) {
String oldCity = city;
city = newCity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ows11Package.ADDRESS_TYPE__CITY, oldCity, city));
}
/**
*
*
* @generated
*/
public String getAdministrativeArea() {
return administrativeArea;
}
/**
*
*
* @generated
*/
public void setAdministrativeArea(String newAdministrativeArea) {
String oldAdministrativeArea = administrativeArea;
administrativeArea = newAdministrativeArea;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ows11Package.ADDRESS_TYPE__ADMINISTRATIVE_AREA, oldAdministrativeArea, administrativeArea));
}
/**
*
*
* @generated
*/
public String getPostalCode() {
return postalCode;
}
/**
*
*
* @generated
*/
public void setPostalCode(String newPostalCode) {
String oldPostalCode = postalCode;
postalCode = newPostalCode;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ows11Package.ADDRESS_TYPE__POSTAL_CODE, oldPostalCode, postalCode));
}
/**
*
*
* @generated
*/
public String getCountry() {
return country;
}
/**
*
*
* @generated
*/
public void setCountry(String newCountry) {
String oldCountry = country;
country = newCountry;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Ows11Package.ADDRESS_TYPE__COUNTRY, oldCountry, country));
}
/**
*
*
* @generated
*/
public EList getElectronicMailAddress() {
if (electronicMailAddress == null) {
electronicMailAddress = new EDataTypeEList(String.class, this, Ows11Package.ADDRESS_TYPE__ELECTRONIC_MAIL_ADDRESS);
}
return electronicMailAddress;
}
/**
*
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Ows11Package.ADDRESS_TYPE__DELIVERY_POINT:
return getDeliveryPoint();
case Ows11Package.ADDRESS_TYPE__CITY:
return getCity();
case Ows11Package.ADDRESS_TYPE__ADMINISTRATIVE_AREA:
return getAdministrativeArea();
case Ows11Package.ADDRESS_TYPE__POSTAL_CODE:
return getPostalCode();
case Ows11Package.ADDRESS_TYPE__COUNTRY:
return getCountry();
case Ows11Package.ADDRESS_TYPE__ELECTRONIC_MAIL_ADDRESS:
return getElectronicMailAddress();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Ows11Package.ADDRESS_TYPE__DELIVERY_POINT:
getDeliveryPoint().clear();
getDeliveryPoint().addAll((Collection)newValue);
return;
case Ows11Package.ADDRESS_TYPE__CITY:
setCity((String)newValue);
return;
case Ows11Package.ADDRESS_TYPE__ADMINISTRATIVE_AREA:
setAdministrativeArea((String)newValue);
return;
case Ows11Package.ADDRESS_TYPE__POSTAL_CODE:
setPostalCode((String)newValue);
return;
case Ows11Package.ADDRESS_TYPE__COUNTRY:
setCountry((String)newValue);
return;
case Ows11Package.ADDRESS_TYPE__ELECTRONIC_MAIL_ADDRESS:
getElectronicMailAddress().clear();
getElectronicMailAddress().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case Ows11Package.ADDRESS_TYPE__DELIVERY_POINT:
getDeliveryPoint().clear();
return;
case Ows11Package.ADDRESS_TYPE__CITY:
setCity(CITY_EDEFAULT);
return;
case Ows11Package.ADDRESS_TYPE__ADMINISTRATIVE_AREA:
setAdministrativeArea(ADMINISTRATIVE_AREA_EDEFAULT);
return;
case Ows11Package.ADDRESS_TYPE__POSTAL_CODE:
setPostalCode(POSTAL_CODE_EDEFAULT);
return;
case Ows11Package.ADDRESS_TYPE__COUNTRY:
setCountry(COUNTRY_EDEFAULT);
return;
case Ows11Package.ADDRESS_TYPE__ELECTRONIC_MAIL_ADDRESS:
getElectronicMailAddress().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case Ows11Package.ADDRESS_TYPE__DELIVERY_POINT:
return deliveryPoint != null && !deliveryPoint.isEmpty();
case Ows11Package.ADDRESS_TYPE__CITY:
return CITY_EDEFAULT == null ? city != null : !CITY_EDEFAULT.equals(city);
case Ows11Package.ADDRESS_TYPE__ADMINISTRATIVE_AREA:
return ADMINISTRATIVE_AREA_EDEFAULT == null ? administrativeArea != null : !ADMINISTRATIVE_AREA_EDEFAULT.equals(administrativeArea);
case Ows11Package.ADDRESS_TYPE__POSTAL_CODE:
return POSTAL_CODE_EDEFAULT == null ? postalCode != null : !POSTAL_CODE_EDEFAULT.equals(postalCode);
case Ows11Package.ADDRESS_TYPE__COUNTRY:
return COUNTRY_EDEFAULT == null ? country != null : !COUNTRY_EDEFAULT.equals(country);
case Ows11Package.ADDRESS_TYPE__ELECTRONIC_MAIL_ADDRESS:
return electronicMailAddress != null && !electronicMailAddress.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (deliveryPoint: ");
result.append(deliveryPoint);
result.append(", city: ");
result.append(city);
result.append(", administrativeArea: ");
result.append(administrativeArea);
result.append(", postalCode: ");
result.append(postalCode);
result.append(", country: ");
result.append(country);
result.append(", electronicMailAddress: ");
result.append(electronicMailAddress);
result.append(')');
return result.toString();
}
} //AddressTypeImpl