bpsim.TimeUnit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbpm-bpmn2-emfextmodel Show documentation
Show all versions of jbpm-bpmn2-emfextmodel Show documentation
jBPM BPMN2 EMF Extension Model
/*
* 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;
/**
*
* 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.
*
*
* If the meaning of 'Ms' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #MS
* @model name="ms"
* @generated
* @ordered
*/
public static final int MS_VALUE = 0;
/**
* The 'S' literal value.
*
*
* If the meaning of 'S' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #S
* @model name="s"
* @generated
* @ordered
*/
public static final int S_VALUE = 1;
/**
* The 'Min' literal value.
*
*
* If the meaning of 'Min' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #MIN
* @model name="min"
* @generated
* @ordered
*/
public static final int MIN_VALUE = 2;
/**
* The 'Hour' literal value.
*
*
* If the meaning of 'Hour' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #HOUR
* @model name="hour"
* @generated
* @ordered
*/
public static final int HOUR_VALUE = 3;
/**
* The 'Day' literal value.
*
*
* If the meaning of 'Day' literal object isn't clear,
* there really should be more of a description here...
*
*
* @see #DAY
* @model name="day"
* @generated
* @ordered
*/
public static final int DAY_VALUE = 4;
/**
* The 'Year' literal value.
*
*
* If the meaning of 'Year' literal object isn't clear,
* there really should be more of a description here...
*
*
* @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.
*
*
* @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.
*
*
* @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.
*
*
* @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
*/
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;
}
} //TimeUnit
© 2015 - 2025 Weber Informatics LLC | Privacy Policy