/**
*/
package robot.robot.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.MinimalEObjectImpl;
import robot.robot.PrintCmd;
import robot.robot.RobotPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Print Cmd</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link robot.robot.impl.PrintCmdImpl#getMsg <em>Msg</em>}</li>
* <li>{@link robot.robot.impl.PrintCmdImpl#getDuration <em>Duration</em>}</li>
* <li>{@link robot.robot.impl.PrintCmdImpl#getLine <em>Line</em>}</li>
* <li>{@link robot.robot.impl.PrintCmdImpl#getCol <em>Col</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PrintCmdImpl extends MinimalEObjectImpl.Container implements PrintCmd {
/**
* The default value of the '{@link #getMsg() <em>Msg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMsg()
* @generated
* @ordered
*/
protected static final String MSG_EDEFAULT = null;
/**
* The cached value of the '{@link #getMsg() <em>Msg</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMsg()
* @generated
* @ordered
*/
protected String msg = MSG_EDEFAULT;
/**
* The default value of the '{@link #getDuration() <em>Duration</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDuration()
* @generated
* @ordered
*/
protected static final Integer DURATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDuration() <em>Duration</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDuration()
* @generated
* @ordered
*/
protected Integer duration = DURATION_EDEFAULT;
/**
* The default value of the '{@link #getLine() <em>Line</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLine()
* @generated
* @ordered
*/
protected static final Integer LINE_EDEFAULT = null;
/**
* The cached value of the '{@link #getLine() <em>Line</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLine()
* @generated
* @ordered
*/
protected Integer line = LINE_EDEFAULT;
/**
* The default value of the '{@link #getCol() <em>Col</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCol()
* @generated
* @ordered
*/
protected static final Integer COL_EDEFAULT = null;
/**
* The cached value of the '{@link #getCol() <em>Col</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCol()
* @generated
* @ordered
*/
protected Integer col = COL_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PrintCmdImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RobotPackage.Literals.PRINT_CMD;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getMsg() {
return msg;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMsg(String newMsg) {
String oldMsg = msg;
msg = newMsg;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RobotPackage.PRINT_CMD__MSG, oldMsg, msg));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Integer getDuration() {
return duration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDuration(Integer newDuration) {
Integer oldDuration = duration;
duration = newDuration;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RobotPackage.PRINT_CMD__DURATION, oldDuration, duration));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Integer getLine() {
return line;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLine(Integer newLine) {
Integer oldLine = line;
line = newLine;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RobotPackage.PRINT_CMD__LINE, oldLine, line));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Integer getCol() {
return col;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCol(Integer newCol) {
Integer oldCol = col;
col = newCol;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RobotPackage.PRINT_CMD__COL, oldCol, col));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RobotPackage.PRINT_CMD__MSG:
return getMsg();
case RobotPackage.PRINT_CMD__DURATION:
return getDuration();
case RobotPackage.PRINT_CMD__LINE:
return getLine();
case RobotPackage.PRINT_CMD__COL:
return getCol();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RobotPackage.PRINT_CMD__MSG:
setMsg((String)newValue);
return;
case RobotPackage.PRINT_CMD__DURATION:
setDuration((Integer)newValue);
return;
case RobotPackage.PRINT_CMD__LINE:
setLine((Integer)newValue);
return;
case RobotPackage.PRINT_CMD__COL:
setCol((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RobotPackage.PRINT_CMD__MSG:
setMsg(MSG_EDEFAULT);
return;
case RobotPackage.PRINT_CMD__DURATION:
setDuration(DURATION_EDEFAULT);
return;
case RobotPackage.PRINT_CMD__LINE:
setLine(LINE_EDEFAULT);
return;
case RobotPackage.PRINT_CMD__COL:
setCol(COL_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RobotPackage.PRINT_CMD__MSG:
return MSG_EDEFAULT == null ? msg != null : !MSG_EDEFAULT.equals(msg);
case RobotPackage.PRINT_CMD__DURATION:
return DURATION_EDEFAULT == null ? duration != null : !DURATION_EDEFAULT.equals(duration);
case RobotPackage.PRINT_CMD__LINE:
return LINE_EDEFAULT == null ? line != null : !LINE_EDEFAULT.equals(line);
case RobotPackage.PRINT_CMD__COL:
return COL_EDEFAULT == null ? col != null : !COL_EDEFAULT.equals(col);
}
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(" (msg: ");
result.append(msg);
result.append(", duration: ");
result.append(duration);
result.append(", line: ");
result.append(line);
result.append(", col: ");
result.append(col);
result.append(')');
return result.toString();
}
} //PrintCmdImpl