/* * 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: ParameterEffectKind.java,v 1.3 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 'Parameter Effect Kind', * and utility methods for working with them. * * * The datatype ParameterEffectKind is an enumeration that indicates the effect of a behavior on values passed in or out of its parameters. * * @see org.eclipse.uml2.uml.UMLPackage#getParameterEffectKind() * @model * @generated */ public enum ParameterEffectKind implements Enumerator { /** * The 'Create' literal object. * * * @see #CREATE * @generated * @ordered */ CREATE_LITERAL(0, "create", "create"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Read' literal object. * * * @see #READ * @generated * @ordered */ READ_LITERAL(1, "read", "read"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Update' literal object. * * * @see #UPDATE * @generated * @ordered */ UPDATE_LITERAL(2, "update", "update"), //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Delete' literal object. * * * @see #DELETE * @generated * @ordered */ DELETE_LITERAL(3, "delete", "delete"); //$NON-NLS-1$ //$NON-NLS-2$ /** * The 'Create' literal value. * * * * Indicates that the behavior creates values. * * @see #CREATE_LITERAL * @model name="create" * @generated * @ordered */ public static final int CREATE = 0; /** * The 'Read' literal value. * * * * Indicates that the behavior reads values. * * @see #READ_LITERAL * @model name="read" * @generated * @ordered */ public static final int READ = 1; /** * The 'Update' literal value. * * * * Indicates that the behavior updates values. * * @see #UPDATE_LITERAL * @model name="update" * @generated * @ordered */ public static final int UPDATE = 2; /** * The 'Delete' literal value. * * * * Indicates that the behavior deletes values. * * @see #DELETE_LITERAL * @model name="delete" * @generated * @ordered */ public static final int DELETE = 3; /** * An array of all the 'Parameter Effect Kind' enumerators. * * * @generated */ private static final ParameterEffectKind[] VALUES_ARRAY = new ParameterEffectKind[]{ CREATE_LITERAL, READ_LITERAL, UPDATE_LITERAL, DELETE_LITERAL,}; /** * A public read-only list of all the 'Parameter Effect Kind' enumerators. * * * @generated */ public static final List VALUES = Collections .unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Parameter Effect Kind' literal with the specified literal value. * * * @generated */ public static ParameterEffectKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ParameterEffectKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Parameter Effect Kind' literal with the specified name. * * * @generated */ public static ParameterEffectKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ParameterEffectKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Parameter Effect Kind' literal with the specified integer value. * * * @generated */ public static ParameterEffectKind get(int value) { switch (value) { case CREATE : return CREATE_LITERAL; case READ : return READ_LITERAL; case UPDATE : return UPDATE_LITERAL; case DELETE : return DELETE_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 ParameterEffectKind(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; } } //ParameterEffectKind