| /** |
| * Copyright (c) 2009 Anyware Technologies 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: |
| * Anyware Technologies - initial API and implementation |
| * |
| * $Id$ |
| */ |
| package org.eclipse.pde.ds.scr; |
| |
| 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>Cardinality</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.pde.ds.scr.ScrPackage#getCardinality() |
| * @model |
| * @generated |
| */ |
| public enum Cardinality implements Enumerator { |
| /** |
| * The '<em><b>01</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #_01_VALUE |
| * @generated |
| * @ordered |
| */ |
| _01(0, "_0_1", "0..1"), |
| |
| /** |
| * The '<em><b>0N</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #_0N_VALUE |
| * @generated |
| * @ordered |
| */ |
| _0N(1, "_0_N", "0..n"), |
| |
| /** |
| * The '<em><b>11</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #_11_VALUE |
| * @generated |
| * @ordered |
| */ |
| _11(2, "_1_1", "1..1"), |
| |
| /** |
| * The '<em><b>1N</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #_1N_VALUE |
| * @generated |
| * @ordered |
| */ |
| _1N(3, "_1_N", "1..n"); |
| |
| /** |
| * The '<em><b>01</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>01</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #_01 |
| * @model name="_0_1" literal="0..1" |
| * @generated |
| * @ordered |
| */ |
| public static final int _01_VALUE = 0; |
| |
| /** |
| * The '<em><b>0N</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>0N</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #_0N |
| * @model name="_0_N" literal="0..n" |
| * @generated |
| * @ordered |
| */ |
| public static final int _0N_VALUE = 1; |
| |
| /** |
| * The '<em><b>11</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>11</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #_11 |
| * @model name="_1_1" literal="1..1" |
| * @generated |
| * @ordered |
| */ |
| public static final int _11_VALUE = 2; |
| |
| /** |
| * The '<em><b>1N</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>1N</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #_1N |
| * @model name="_1_N" literal="1..n" |
| * @generated |
| * @ordered |
| */ |
| public static final int _1N_VALUE = 3; |
| |
| /** |
| * An array of all the '<em><b>Cardinality</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final Cardinality[] VALUES_ARRAY = |
| new Cardinality[] { |
| _01, |
| _0N, |
| _11, |
| _1N, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>Cardinality</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List<Cardinality> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>Cardinality</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Cardinality get(String literal) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| Cardinality result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Cardinality</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Cardinality getByName(String name) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| Cardinality result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Cardinality</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Cardinality get(int value) { |
| switch (value) { |
| case _01_VALUE: return _01; |
| case _0N_VALUE: return _0N; |
| case _11_VALUE: return _11; |
| case _1N_VALUE: return _1N; |
| } |
| 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 Cardinality(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; |
| } |
| |
| } //Cardinality |