/******************************************************************************* * Copyright (c) 2006, 2012 Obeo. * 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: * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.emf.compare.diff.metamodel; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * A representation of the literals of the enumeration 'Difference Kind', * and utility methods for working with them. * * These flags will be used to describe the kind of a DiffElement. * * @see org.eclipse.emf.compare.diff.metamodel.DiffPackage#getDifferenceKind() * @model * @generated */ public enum DifferenceKind implements Enumerator { /** * The 'Addition' literal object. * * @see #ADDITION_VALUE * @generated * @ordered */ ADDITION(0, "Addition", "Addition"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Deletion' literal object. * * @see #DELETION_VALUE * @generated * @ordered */ DELETION(1, "Deletion", "Deletion"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Change' literal object. * * @see #CHANGE_VALUE * @generated * @ordered */ CHANGE(2, "Change", "Change"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Move' literal object. * * @see #MOVE_VALUE * @generated * @ordered */ MOVE(3, "Move", "Move"); //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Addition' literal value. * *

* If the meaning of 'Addition' literal object isn't clear, there really should be * more of a description here... *

* * @see #ADDITION * @model name="Addition" * @generated * @ordered */ public static final int ADDITION_VALUE = 0; /** * The 'Deletion' literal value. * *

* If the meaning of 'Deletion' literal object isn't clear, there really should be * more of a description here... *

* * @see #DELETION * @model name="Deletion" * @generated * @ordered */ public static final int DELETION_VALUE = 1; /** * The 'Change' literal value. * *

* If the meaning of 'Change' literal object isn't clear, there really should be more * of a description here... *

* * @see #CHANGE * @model name="Change" * @generated * @ordered */ public static final int CHANGE_VALUE = 2; /** * The 'Move' literal value. * *

* If the meaning of 'Move' literal object isn't clear, there really should be more * of a description here... *

* * @see #MOVE * @model name="Move" * @generated * @ordered */ public static final int MOVE_VALUE = 3; /** * An array of all the 'Difference Kind' enumerators. * * @generated */ private static final DifferenceKind[] VALUES_ARRAY = new DifferenceKind[] {ADDITION, DELETION, CHANGE, MOVE, }; /** * A public read-only list of all the 'Difference Kind' enumerators. * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays .asList(VALUES_ARRAY)); /** * Returns the 'Difference Kind' literal with the specified literal value. * * @generated */ public static DifferenceKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { DifferenceKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Difference Kind' literal with the specified name. * * @generated */ public static DifferenceKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { DifferenceKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Difference Kind' literal with the specified integer value. * * @generated */ public static DifferenceKind get(int value) { switch (value) { case ADDITION_VALUE: return ADDITION; case DELETION_VALUE: return DELETION; case CHANGE_VALUE: return CHANGE; case MOVE_VALUE: return MOVE; } return null; } /** * * @generated */ private final int value; /** * * @generated */ private final String name; /** * * @generated */ private final String literal; /** * Only this class can construct instances. * * @generated */ @SuppressWarnings("hiding") private DifferenceKind(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * @generated */ public int getValue() { return value; } /** * * @generated */ public String getName() { return name; } /** * * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * * @generated */ @Override public String toString() { return literal; } } // DifferenceKind