/** * Copyright (c) 2003-2010 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 - Initial API and implementation */ package org.eclipse.emf.ecore.change; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * <!-- begin-user-doc --> * A representation of the literals of the enumeration '<em><b>Kind</b></em>', * and utility methods for working with them. * <!-- end-user-doc --> * @see org.eclipse.emf.ecore.change.ChangePackage#getChangeKind() * @model * @generated */ public enum ChangeKind implements Enumerator { /** * The '<em><b>ADD</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #ADD * @generated * @ordered */ ADD_LITERAL(0, "ADD", "ADD"), /** * The '<em><b>REMOVE</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #REMOVE * @generated * @ordered */ REMOVE_LITERAL(1, "REMOVE", "REMOVE"), /** * The '<em><b>MOVE</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #MOVE * @generated * @ordered */ MOVE_LITERAL(2, "MOVE", "MOVE"); /** * The '<em><b>ADD</b></em>' literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #ADD_LITERAL * @model * @generated * @ordered */ public static final int ADD = 0; /** * The '<em><b>REMOVE</b></em>' literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #REMOVE_LITERAL * @model * @generated * @ordered */ public static final int REMOVE = 1; /** * The '<em><b>MOVE</b></em>' literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #MOVE_LITERAL * @model * @generated * @ordered */ public static final int MOVE = 2; /** * An array of all the '<em><b>Kind</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final ChangeKind[] VALUES_ARRAY = new ChangeKind[] { ADD_LITERAL, REMOVE_LITERAL, MOVE_LITERAL, }; /** * A public read-only list of all the '<em><b>Kind</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final List<ChangeKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the '<em><b>Kind</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ChangeKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ChangeKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the '<em><b>Kind</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ChangeKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ChangeKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the '<em><b>Kind</b></em>' literal with the specified integer value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ChangeKind get(int value) { switch (value) { case ADD: return ADD_LITERAL; case REMOVE: return REMOVE_LITERAL; case MOVE: return MOVE_LITERAL; } return null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final int value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String name; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String literal; /** * Only this class can construct instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private ChangeKind(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { return literal; } }