blob: 0795601f5cb9111d6e762e4bda05186e18888320 [file] [log] [blame]
/**
* Copyright (c) 2006, 2007 Borland Software Corporation.
* 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:
* Richard Gronback (Borland) - initial API and implementation
*
* $Id: RelationshipType.java,v 1.1 2007/10/31 13:49:16 rgronback Exp $
*/
package org.eclipse.gmf.examples.mindmap;
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>Relationship Type</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.gmf.examples.mindmap.MindmapPackage#getRelationshipType()
* @model
* @generated
*/
public enum RelationshipType implements Enumerator {
/**
* The '<em><b>DEPENDENCY</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #DEPENDENCY_VALUE
* @generated
* @ordered
*/
DEPENDENCY(0, "DEPENDENCY", "DEPENDENCY"),
/**
* The '<em><b>INCLUDES</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #INCLUDES_VALUE
* @generated
* @ordered
*/
INCLUDES(1, "INCLUDES", "INCLUDES"),
/**
* The '<em><b>EXTENDS</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #EXTENDS_VALUE
* @generated
* @ordered
*/
EXTENDS(2, "EXTENDS", "EXTENDS");
/**
* The '<em><b>DEPENDENCY</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>DEPENDENCY</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #DEPENDENCY
* @model
* @generated
* @ordered
*/
public static final int DEPENDENCY_VALUE = 0;
/**
* The '<em><b>INCLUDES</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>INCLUDES</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #INCLUDES
* @model
* @generated
* @ordered
*/
public static final int INCLUDES_VALUE = 1;
/**
* The '<em><b>EXTENDS</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>EXTENDS</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #EXTENDS
* @model
* @generated
* @ordered
*/
public static final int EXTENDS_VALUE = 2;
/**
* An array of all the '<em><b>Relationship Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final RelationshipType[] VALUES_ARRAY =
new RelationshipType[] {
DEPENDENCY,
INCLUDES,
EXTENDS,
};
/**
* A public read-only list of all the '<em><b>Relationship Type</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<RelationshipType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Relationship Type</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static RelationshipType get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
RelationshipType result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Relationship Type</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static RelationshipType getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
RelationshipType result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Relationship Type</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static RelationshipType get(int value) {
switch (value) {
case DEPENDENCY_VALUE: return DEPENDENCY;
case INCLUDES_VALUE: return INCLUDES;
case EXTENDS_VALUE: return EXTENDS;
}
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 RelationshipType(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;
}
} //RelationshipType