/** | |
* | |
* Copyright (c) 2009 Hatha Systems. | |
* 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: | |
* Nikolai Mansourov (Hatha Systems) - initial API and implementation | |
* Gabriel Barbier (Mia-Software) - minor evolutions for version 1.1 | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.omg.kdm.code; | |
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>Parameter Kind</b></em>', | |
* and utility methods for working with them. | |
* <!-- end-user-doc --> | |
* @see org.eclipse.gmt.modisco.omg.kdm.code.CodePackage#getParameterKind() | |
* @model | |
* @generated | |
*/ | |
public enum ParameterKind implements Enumerator { | |
/** | |
* The '<em><b>By Value</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #BY_VALUE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
BY_VALUE(0, "byValue", "byValue"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>By Name</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #BY_NAME_VALUE | |
* @generated | |
* @ordered | |
*/ | |
BY_NAME(1, "byName", "byName"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>By Reference</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #BY_REFERENCE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
BY_REFERENCE(2, "byReference", "byReference"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Variadic</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #VARIADIC_VALUE | |
* @generated | |
* @ordered | |
*/ | |
VARIADIC(3, "variadic", "variadic"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Return</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #RETURN_VALUE | |
* @generated | |
* @ordered | |
*/ | |
RETURN(4, "return", "return"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Throws</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #THROWS_VALUE | |
* @generated | |
* @ordered | |
*/ | |
THROWS(5, "throws", "throws"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Exception</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #EXCEPTION_VALUE | |
* @generated | |
* @ordered | |
*/ | |
EXCEPTION(6, "exception", "exception"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Catchall</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #CATCHALL_VALUE | |
* @generated | |
* @ordered | |
*/ | |
CATCHALL(7, "catchall", "catchall"), //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>Unknown</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UNKNOWN_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UNKNOWN(8, "unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$ | |
/** | |
* The '<em><b>By Value</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>By Value</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #BY_VALUE | |
* @model name="byValue" | |
* @generated | |
* @ordered | |
*/ | |
public static final int BY_VALUE_VALUE = 0; | |
/** | |
* The '<em><b>By Name</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>By Name</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #BY_NAME | |
* @model name="byName" | |
* @generated | |
* @ordered | |
*/ | |
public static final int BY_NAME_VALUE = 1; | |
/** | |
* The '<em><b>By Reference</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>By Reference</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #BY_REFERENCE | |
* @model name="byReference" | |
* @generated | |
* @ordered | |
*/ | |
public static final int BY_REFERENCE_VALUE = 2; | |
/** | |
* The '<em><b>Variadic</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Variadic</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #VARIADIC | |
* @model name="variadic" | |
* @generated | |
* @ordered | |
*/ | |
public static final int VARIADIC_VALUE = 3; | |
/** | |
* The '<em><b>Return</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Return</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #RETURN | |
* @model name="return" | |
* @generated | |
* @ordered | |
*/ | |
public static final int RETURN_VALUE = 4; | |
/** | |
* The '<em><b>Throws</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Throws</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #THROWS | |
* @model name="throws" | |
* @generated | |
* @ordered | |
*/ | |
public static final int THROWS_VALUE = 5; | |
/** | |
* The '<em><b>Exception</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Exception</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #EXCEPTION | |
* @model name="exception" | |
* @generated | |
* @ordered | |
*/ | |
public static final int EXCEPTION_VALUE = 6; | |
/** | |
* The '<em><b>Catchall</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Catchall</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #CATCHALL | |
* @model name="catchall" | |
* @generated | |
* @ordered | |
*/ | |
public static final int CATCHALL_VALUE = 7; | |
/** | |
* The '<em><b>Unknown</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Unknown</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UNKNOWN | |
* @model name="unknown" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UNKNOWN_VALUE = 8; | |
/** | |
* An array of all the '<em><b>Parameter Kind</b></em>' enumerators. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private static final ParameterKind[] VALUES_ARRAY = | |
new ParameterKind[] { | |
BY_VALUE, | |
BY_NAME, | |
BY_REFERENCE, | |
VARIADIC, | |
RETURN, | |
THROWS, | |
EXCEPTION, | |
CATCHALL, | |
UNKNOWN, | |
}; | |
/** | |
* A public read-only list of all the '<em><b>Parameter Kind</b></em>' enumerators. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static final List<ParameterKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); | |
/** | |
* Returns the '<em><b>Parameter Kind</b></em>' literal with the specified literal value. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static ParameterKind get(String literal) { | |
for (int i = 0; i < VALUES_ARRAY.length; ++i) { | |
ParameterKind result = VALUES_ARRAY[i]; | |
if (result.toString().equals(literal)) { | |
return result; | |
} | |
} | |
return null; | |
} | |
/** | |
* Returns the '<em><b>Parameter Kind</b></em>' literal with the specified name. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static ParameterKind getByName(String name) { | |
for (int i = 0; i < VALUES_ARRAY.length; ++i) { | |
ParameterKind result = VALUES_ARRAY[i]; | |
if (result.getName().equals(name)) { | |
return result; | |
} | |
} | |
return null; | |
} | |
/** | |
* Returns the '<em><b>Parameter Kind</b></em>' literal with the specified integer value. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static ParameterKind get(int value) { | |
switch (value) { | |
case BY_VALUE_VALUE: return BY_VALUE; | |
case BY_NAME_VALUE: return BY_NAME; | |
case BY_REFERENCE_VALUE: return BY_REFERENCE; | |
case VARIADIC_VALUE: return VARIADIC; | |
case RETURN_VALUE: return RETURN; | |
case THROWS_VALUE: return THROWS; | |
case EXCEPTION_VALUE: return EXCEPTION; | |
case CATCHALL_VALUE: return CATCHALL; | |
case UNKNOWN_VALUE: return UNKNOWN; | |
} | |
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 ParameterKind(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; | |
} | |
} //ParameterKind |