/*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.oasisopen.names.tc.opendocument.xmlns.datastyle.DatastylePackage;
import org.oasisopen.names.tc.opendocument.xmlns.datastyle.MonthType;
import org.oasisopen.names.tc.opendocument.xmlns.datastyle.StyleType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Month Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.MonthTypeImpl#getCalendar <em>Calendar</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.MonthTypeImpl#getPossessiveForm <em>Possessive Form</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.MonthTypeImpl#getStyle <em>Style</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.datastyle.impl.MonthTypeImpl#getTextual <em>Textual</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MonthTypeImpl extends EObjectImpl implements MonthType {
/**
* The default value of the '{@link #getCalendar() <em>Calendar</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCalendar()
* @generated
* @ordered
*/
protected static final Object CALENDAR_EDEFAULT = null;
/**
* The cached value of the '{@link #getCalendar() <em>Calendar</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCalendar()
* @generated
* @ordered
*/
protected Object calendar = CALENDAR_EDEFAULT;
/**
* The default value of the '{@link #getPossessiveForm() <em>Possessive Form</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPossessiveForm()
* @generated
* @ordered
*/
protected static final org.oasisopen.names.tc.opendocument.xmlns.text.Boolean POSSESSIVE_FORM_EDEFAULT = org.oasisopen.names.tc.opendocument.xmlns.text.Boolean.FALSE;
/**
* The cached value of the '{@link #getPossessiveForm() <em>Possessive Form</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPossessiveForm()
* @generated
* @ordered
*/
protected org.oasisopen.names.tc.opendocument.xmlns.text.Boolean possessiveForm = POSSESSIVE_FORM_EDEFAULT;
/**
* This is true if the Possessive Form attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean possessiveFormESet;
/**
* The default value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected static final StyleType STYLE_EDEFAULT = StyleType.SHORT;
/**
* The cached value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected StyleType style = STYLE_EDEFAULT;
/**
* This is true if the Style attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean styleESet;
/**
* The default value of the '{@link #getTextual() <em>Textual</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextual()
* @generated
* @ordered
*/
protected static final org.oasisopen.names.tc.opendocument.xmlns.text.Boolean TEXTUAL_EDEFAULT = org.oasisopen.names.tc.opendocument.xmlns.text.Boolean.FALSE;
/**
* The cached value of the '{@link #getTextual() <em>Textual</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextual()
* @generated
* @ordered
*/
protected org.oasisopen.names.tc.opendocument.xmlns.text.Boolean textual = TEXTUAL_EDEFAULT;
/**
* This is true if the Textual attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean textualESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MonthTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DatastylePackage.Literals.MONTH_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getCalendar() {
return calendar;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCalendar(Object newCalendar) {
Object oldCalendar = calendar;
calendar = newCalendar;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.MONTH_TYPE__CALENDAR, oldCalendar, calendar));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.oasisopen.names.tc.opendocument.xmlns.text.Boolean getPossessiveForm() {
return possessiveForm;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPossessiveForm(org.oasisopen.names.tc.opendocument.xmlns.text.Boolean newPossessiveForm) {
org.oasisopen.names.tc.opendocument.xmlns.text.Boolean oldPossessiveForm = possessiveForm;
possessiveForm = newPossessiveForm == null ? POSSESSIVE_FORM_EDEFAULT : newPossessiveForm;
boolean oldPossessiveFormESet = possessiveFormESet;
possessiveFormESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM, oldPossessiveForm, possessiveForm, !oldPossessiveFormESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetPossessiveForm() {
org.oasisopen.names.tc.opendocument.xmlns.text.Boolean oldPossessiveForm = possessiveForm;
boolean oldPossessiveFormESet = possessiveFormESet;
possessiveForm = POSSESSIVE_FORM_EDEFAULT;
possessiveFormESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM, oldPossessiveForm, POSSESSIVE_FORM_EDEFAULT, oldPossessiveFormESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetPossessiveForm() {
return possessiveFormESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StyleType getStyle() {
return style;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStyle(StyleType newStyle) {
StyleType oldStyle = style;
style = newStyle == null ? STYLE_EDEFAULT : newStyle;
boolean oldStyleESet = styleESet;
styleESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.MONTH_TYPE__STYLE, oldStyle, style, !oldStyleESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetStyle() {
StyleType oldStyle = style;
boolean oldStyleESet = styleESet;
style = STYLE_EDEFAULT;
styleESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DatastylePackage.MONTH_TYPE__STYLE, oldStyle, STYLE_EDEFAULT, oldStyleESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetStyle() {
return styleESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.oasisopen.names.tc.opendocument.xmlns.text.Boolean getTextual() {
return textual;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTextual(org.oasisopen.names.tc.opendocument.xmlns.text.Boolean newTextual) {
org.oasisopen.names.tc.opendocument.xmlns.text.Boolean oldTextual = textual;
textual = newTextual == null ? TEXTUAL_EDEFAULT : newTextual;
boolean oldTextualESet = textualESet;
textualESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DatastylePackage.MONTH_TYPE__TEXTUAL, oldTextual, textual, !oldTextualESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetTextual() {
org.oasisopen.names.tc.opendocument.xmlns.text.Boolean oldTextual = textual;
boolean oldTextualESet = textualESet;
textual = TEXTUAL_EDEFAULT;
textualESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DatastylePackage.MONTH_TYPE__TEXTUAL, oldTextual, TEXTUAL_EDEFAULT, oldTextualESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetTextual() {
return textualESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DatastylePackage.MONTH_TYPE__CALENDAR:
return getCalendar();
case DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM:
return getPossessiveForm();
case DatastylePackage.MONTH_TYPE__STYLE:
return getStyle();
case DatastylePackage.MONTH_TYPE__TEXTUAL:
return getTextual();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DatastylePackage.MONTH_TYPE__CALENDAR:
setCalendar(newValue);
return;
case DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM:
setPossessiveForm((org.oasisopen.names.tc.opendocument.xmlns.text.Boolean)newValue);
return;
case DatastylePackage.MONTH_TYPE__STYLE:
setStyle((StyleType)newValue);
return;
case DatastylePackage.MONTH_TYPE__TEXTUAL:
setTextual((org.oasisopen.names.tc.opendocument.xmlns.text.Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DatastylePackage.MONTH_TYPE__CALENDAR:
setCalendar(CALENDAR_EDEFAULT);
return;
case DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM:
unsetPossessiveForm();
return;
case DatastylePackage.MONTH_TYPE__STYLE:
unsetStyle();
return;
case DatastylePackage.MONTH_TYPE__TEXTUAL:
unsetTextual();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DatastylePackage.MONTH_TYPE__CALENDAR:
return CALENDAR_EDEFAULT == null ? calendar != null : !CALENDAR_EDEFAULT.equals(calendar);
case DatastylePackage.MONTH_TYPE__POSSESSIVE_FORM:
return isSetPossessiveForm();
case DatastylePackage.MONTH_TYPE__STYLE:
return isSetStyle();
case DatastylePackage.MONTH_TYPE__TEXTUAL:
return isSetTextual();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (calendar: ");
result.append(calendar);
result.append(", possessiveForm: ");
if (possessiveFormESet) result.append(possessiveForm); else result.append("<unset>");
result.append(", style: ");
if (styleESet) result.append(style); else result.append("<unset>");
result.append(", textual: ");
if (textualESet) result.append(textual); else result.append("<unset>");
result.append(')');
return result.toString();
}
} //MonthTypeImpl