/* * Copyright (c) 2006 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 * * $Id: MessageKind.java,v 1.5 2006/12/14 15:49:28 khussey Exp $ */ package org.eclipse.uml2.uml; 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 'Message Kind', * and utility methods for working with them. * * * This is an enumerated type that identifies the type of message. * * @see org.eclipse.uml2.uml.UMLPackage#getMessageKind() * @model * @generated */ public enum MessageKind implements Enumerator { /** * The 'Complete' literal object. * * * @see #COMPLETE * @generated * @ordered */ COMPLETE_LITERAL(0, "complete", "complete"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Lost' literal object. * * * @see #LOST * @generated * @ordered */ LOST_LITERAL(1, "lost", "lost"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Found' literal object. * * * @see #FOUND * @generated * @ordered */ FOUND_LITERAL(2, "found", "found"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Unknown' literal object. * * * @see #UNKNOWN * @generated * @ordered */ UNKNOWN_LITERAL(3, "unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Complete' literal value. * * * * sendEvent and receiveEvent are present * * @see #COMPLETE_LITERAL * @model name="complete" * @generated * @ordered */ public static final int COMPLETE = 0; /** * The 'Lost' literal value. * * * * sendEvent present and receiveEvent absent * * @see #LOST_LITERAL * @model name="lost" * @generated * @ordered */ public static final int LOST = 1; /** * The 'Found' literal value. * * * * sendEvent absent and receiveEvent present * * @see #FOUND_LITERAL * @model name="found" * @generated * @ordered */ public static final int FOUND = 2; /** * The 'Unknown' literal value. * * * * sendEvent and receiveEvent absent (should not appear) * * @see #UNKNOWN_LITERAL * @model name="unknown" * @generated * @ordered */ public static final int UNKNOWN = 3; /** * An array of all the 'Message Kind' enumerators. * * * @generated */ private static final MessageKind[] VALUES_ARRAY = new MessageKind[]{ COMPLETE_LITERAL, LOST_LITERAL, FOUND_LITERAL, UNKNOWN_LITERAL,}; /** * A public read-only list of all the 'Message Kind' enumerators. * * * @generated */ public static final List VALUES = Collections .unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Message Kind' literal with the specified literal value. * * * @generated */ public static MessageKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { MessageKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Message Kind' literal with the specified name. * * * @generated */ public static MessageKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { MessageKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Message Kind' literal with the specified integer value. * * * @generated */ public static MessageKind get(int value) { switch (value) { case COMPLETE : return COMPLETE_LITERAL; case LOST : return LOST_LITERAL; case FOUND : return FOUND_LITERAL; case UNKNOWN : return UNKNOWN_LITERAL; } return null; } /** * * * @generated */ private final int value; /** * * * @generated */ private final String name; /** * * * @generated */ private final String literal; /** * Only this class can construct instances. * * * @generated */ private MessageKind(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; } } //MessageKind