All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bpsim.TimeUnit Maven / Gradle / Ivy

/**
 */
package bpsim;

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 'Time Unit',
 * and utility methods for working with them.
 * 
 * @see bpsim.BpsimPackage#getTimeUnit()
 * @model extendedMetaData="name='TimeUnit'"
 * @generated
 */
public enum TimeUnit implements Enumerator {
	/**
	 * The 'Ms' literal object.
	 * 
	 * 
	 * @see #MS_VALUE
	 * @generated
	 * @ordered
	 */
	MS(0, "ms", "ms"),

	/**
	 * The 'S' literal object.
	 * 
	 * 
	 * @see #S_VALUE
	 * @generated
	 * @ordered
	 */
	S(1, "s", "s"),

	/**
	 * The 'Min' literal object.
	 * 
	 * 
	 * @see #MIN_VALUE
	 * @generated
	 * @ordered
	 */
	MIN(2, "min", "min"),

	/**
	 * The 'Hour' literal object.
	 * 
	 * 
	 * @see #HOUR_VALUE
	 * @generated
	 * @ordered
	 */
	HOUR(3, "hour", "hour"),

	/**
	 * The 'Day' literal object.
	 * 
	 * 
	 * @see #DAY_VALUE
	 * @generated
	 * @ordered
	 */
	DAY(4, "day", "day"),

	/**
	 * The 'Year' literal object.
	 * 
	 * 
	 * @see #YEAR_VALUE
	 * @generated
	 * @ordered
	 */
	YEAR(5, "year", "year");

	/**
	 * The 'Ms' literal value.
	 * 
	 * 
	 * @see #MS
	 * @model name="ms"
	 * @generated
	 * @ordered
	 */
	public static final int MS_VALUE = 0;

	/**
	 * The 'S' literal value.
	 * 
	 * 
	 * @see #S
	 * @model name="s"
	 * @generated
	 * @ordered
	 */
	public static final int S_VALUE = 1;

	/**
	 * The 'Min' literal value.
	 * 
	 * 
	 * @see #MIN
	 * @model name="min"
	 * @generated
	 * @ordered
	 */
	public static final int MIN_VALUE = 2;

	/**
	 * The 'Hour' literal value.
	 * 
	 * 
	 * @see #HOUR
	 * @model name="hour"
	 * @generated
	 * @ordered
	 */
	public static final int HOUR_VALUE = 3;

	/**
	 * The 'Day' literal value.
	 * 
	 * 
	 * @see #DAY
	 * @model name="day"
	 * @generated
	 * @ordered
	 */
	public static final int DAY_VALUE = 4;

	/**
	 * The 'Year' literal value.
	 * 
	 * 
	 * @see #YEAR
	 * @model name="year"
	 * @generated
	 * @ordered
	 */
	public static final int YEAR_VALUE = 5;

	/**
	 * An array of all the 'Time Unit' enumerators.
	 * 
	 * 
	 * @generated
	 */
	private static final TimeUnit[] VALUES_ARRAY =
		new TimeUnit[] {
			MS,
			S,
			MIN,
			HOUR,
			DAY,
			YEAR,
		};

	/**
	 * A public read-only list of all the 'Time Unit' enumerators.
	 * 
	 * 
	 * @generated
	 */
	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the 'Time Unit' literal with the specified literal value.
	 * 
	 * 
	 * @param literal the literal.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static TimeUnit get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TimeUnit result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the 'Time Unit' literal with the specified name.
	 * 
	 * 
	 * @param name the name.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static TimeUnit getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TimeUnit result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the 'Time Unit' literal with the specified integer value.
	 * 
	 * 
	 * @param value the integer value.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static TimeUnit get(int value) {
		switch (value) {
			case MS_VALUE: return MS;
			case S_VALUE: return S;
			case MIN_VALUE: return MIN;
			case HOUR_VALUE: return HOUR;
			case DAY_VALUE: return DAY;
			case YEAR_VALUE: return YEAR;
		}
		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 TimeUnit(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public int getValue() {
	  return value;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public String getName() {
	  return name;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * 
	 * 
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //TimeUnit




© 2015 - 2025 Weber Informatics LLC | Privacy Policy