/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** */ package bpsim; 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>Result Type</b></em>', * and utility methods for working with them. * <!-- end-user-doc --> * @see bpsim.BpsimPackage#getResultType() * @model extendedMetaData="name='ResultType'" * @generated */ public enum ResultType implements Enumerator { /** * The '<em><b>Min</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #MIN_VALUE * @generated * @ordered */ MIN(0, "min", "min"), /** * The '<em><b>Max</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #MAX_VALUE * @generated * @ordered */ MAX(1, "max", "max"), /** * The '<em><b>Mean</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #MEAN_VALUE * @generated * @ordered */ MEAN(2, "mean", "mean"), /** * The '<em><b>Count</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #COUNT_VALUE * @generated * @ordered */ COUNT(3, "count", "count"), /** * The '<em><b>Sum</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #SUM_VALUE * @generated * @ordered */ SUM(4, "sum", "sum"); /** * The '<em><b>Min</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Min</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #MIN * @model name="min" * @generated * @ordered */ public static final int MIN_VALUE = 0; /** * The '<em><b>Max</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Max</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #MAX * @model name="max" * @generated * @ordered */ public static final int MAX_VALUE = 1; /** * The '<em><b>Mean</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Mean</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #MEAN * @model name="mean" * @generated * @ordered */ public static final int MEAN_VALUE = 2; /** * The '<em><b>Count</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Count</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #COUNT * @model name="count" * @generated * @ordered */ public static final int COUNT_VALUE = 3; /** * The '<em><b>Sum</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Sum</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #SUM * @model name="sum" * @generated * @ordered */ public static final int SUM_VALUE = 4; /** * An array of all the '<em><b>Result Type</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final ResultType[] VALUES_ARRAY = new ResultType[] { MIN, MAX, MEAN, COUNT, SUM, }; /** * A public read-only list of all the '<em><b>Result Type</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final List<ResultType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the '<em><b>Result Type</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ResultType get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ResultType result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the '<em><b>Result Type</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ResultType getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ResultType result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the '<em><b>Result Type</b></em>' literal with the specified integer value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static ResultType get(int value) { switch (value) { case MIN_VALUE: return MIN; case MAX_VALUE: return MAX; case MEAN_VALUE: return MEAN; case COUNT_VALUE: return COUNT; case SUM_VALUE: return SUM; } 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 ResultType(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; } } //ResultType