/******************************************************************************* * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, ARTAL * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Borland - initial API and implementation * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 ******************************************************************************/ /** * * * * $Id$ */ package org.eclipse.papyrus.gmf.gmfgraph; 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 'Direction', * and utility methods for working with them. * * * Geographical bit constants from org.eclipse.draw2d.PositionConstants * * @see org.eclipse.papyrus.gmf.gmfgraph.GMFGraphPackage#getDirection() * @model * @generated */ public enum Direction implements Enumerator { /** * The 'NONE' literal object. * * * @see #NONE * @generated * @ordered */ NONE_LITERAL(0, "NONE", "NONE"), /** * The 'NORTH' literal object. * * * @see #NORTH * @generated * @ordered */ NORTH_LITERAL(1, "NORTH", "NORTH"), /** * The 'SOUTH' literal object. * * * @see #SOUTH * @generated * @ordered */ SOUTH_LITERAL(4, "SOUTH", "SOUTH"), /** * The 'WEST' literal object. * * * @see #WEST * @generated * @ordered */ WEST_LITERAL(8, "WEST", "WEST"), /** * The 'EAST' literal object. * * * @see #EAST * @generated * @ordered */ EAST_LITERAL(16, "EAST", "EAST"), /** * The 'NORTH EAST' literal object. * * * @see #NORTH_EAST * @generated * @ordered */ NORTH_EAST_LITERAL(17, "NORTH_EAST", "NORTH_EAST"), /** * The 'NORTH WEST' literal object. * * * @see #NORTH_WEST * @generated * @ordered */ NORTH_WEST_LITERAL(9, "NORTH_WEST", "NORTH_WEST"), /** * The 'SOUTH EAST' literal object. * * * @see #SOUTH_EAST * @generated * @ordered */ SOUTH_EAST_LITERAL(20, "SOUTH_EAST", "SOUTH_EAST"), /** * The 'SOUTH WEST' literal object. * * * @see #SOUTH_WEST * @generated * @ordered */ SOUTH_WEST_LITERAL(12, "SOUTH_WEST", "SOUTH_WEST"), /** * The 'NORTH SOUTH' literal object. * * * @see #NORTH_SOUTH * @generated * @ordered */ NORTH_SOUTH_LITERAL(5, "NORTH_SOUTH", "NORTH_SOUTH"), /** * The 'EAST WEST' literal object. * * * @see #EAST_WEST * @generated * @ordered */ EAST_WEST_LITERAL(24, "EAST_WEST", "EAST_WEST"), /** * The 'NSEW' literal object. * * * @see #NSEW * @generated * @ordered */ NSEW_LITERAL(29, "NSEW", "NSEW"); /** * The 'NONE' literal value. * *

* If the meaning of 'NONE' literal object isn't clear, * there really should be more of a description here... *

* * @see #NONE_LITERAL * @model * @generated * @ordered */ public static final int NONE = 0; /** * The 'NORTH' literal value. * *

* If the meaning of 'NORTH' literal object isn't clear, * there really should be more of a description here... *

* * @see #NORTH_LITERAL * @model * @generated * @ordered */ public static final int NORTH = 1; /** * The 'SOUTH' literal value. * *

* If the meaning of 'SOUTH' literal object isn't clear, * there really should be more of a description here... *

* * @see #SOUTH_LITERAL * @model * @generated * @ordered */ public static final int SOUTH = 4; /** * The 'WEST' literal value. * *

* If the meaning of 'WEST' literal object isn't clear, * there really should be more of a description here... *

* * @see #WEST_LITERAL * @model * @generated * @ordered */ public static final int WEST = 8; /** * The 'EAST' literal value. * *

* If the meaning of 'EAST' literal object isn't clear, * there really should be more of a description here... *

* * @see #EAST_LITERAL * @model * @generated * @ordered */ public static final int EAST = 16; /** * The 'NORTH EAST' literal value. * *

* If the meaning of 'NORTH EAST' literal object isn't clear, * there really should be more of a description here... *

* * @see #NORTH_EAST_LITERAL * @model * @generated * @ordered */ public static final int NORTH_EAST = 17; /** * The 'NORTH WEST' literal value. * *

* If the meaning of 'NORTH WEST' literal object isn't clear, * there really should be more of a description here... *

* * @see #NORTH_WEST_LITERAL * @model * @generated * @ordered */ public static final int NORTH_WEST = 9; /** * The 'SOUTH EAST' literal value. * *

* If the meaning of 'SOUTH EAST' literal object isn't clear, * there really should be more of a description here... *

* * @see #SOUTH_EAST_LITERAL * @model * @generated * @ordered */ public static final int SOUTH_EAST = 20; /** * The 'SOUTH WEST' literal value. * *

* If the meaning of 'SOUTH WEST' literal object isn't clear, * there really should be more of a description here... *

* * @see #SOUTH_WEST_LITERAL * @model * @generated * @ordered */ public static final int SOUTH_WEST = 12; /** * The 'NORTH SOUTH' literal value. * *

* If the meaning of 'NORTH SOUTH' literal object isn't clear, * there really should be more of a description here... *

* * @see #NORTH_SOUTH_LITERAL * @model * @generated * @ordered */ public static final int NORTH_SOUTH = 5; /** * The 'EAST WEST' literal value. * *

* If the meaning of 'EAST WEST' literal object isn't clear, * there really should be more of a description here... *

* * @see #EAST_WEST_LITERAL * @model * @generated * @ordered */ public static final int EAST_WEST = 24; /** * The 'NSEW' literal value. * *

* If the meaning of 'NSEW' literal object isn't clear, * there really should be more of a description here... *

* * @see #NSEW_LITERAL * @model * @generated * @ordered */ public static final int NSEW = 29; /** * An array of all the 'Direction' enumerators. * * * @generated */ private static final Direction[] VALUES_ARRAY = new Direction[] { NONE_LITERAL, NORTH_LITERAL, SOUTH_LITERAL, WEST_LITERAL, EAST_LITERAL, NORTH_EAST_LITERAL, NORTH_WEST_LITERAL, SOUTH_EAST_LITERAL, SOUTH_WEST_LITERAL, NORTH_SOUTH_LITERAL, EAST_WEST_LITERAL, NSEW_LITERAL, }; /** * A public read-only list of all the 'Direction' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Direction' literal with the specified literal value. * * * @generated */ public static Direction get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { Direction result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Direction' literal with the specified name. * * * @generated */ public static Direction getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { Direction result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Direction' literal with the specified integer value. * * * @generated */ public static Direction get(int value) { switch (value) { case NONE: return NONE_LITERAL; case NORTH: return NORTH_LITERAL; case SOUTH: return SOUTH_LITERAL; case WEST: return WEST_LITERAL; case EAST: return EAST_LITERAL; case NORTH_EAST: return NORTH_EAST_LITERAL; case NORTH_WEST: return NORTH_WEST_LITERAL; case SOUTH_EAST: return SOUTH_EAST_LITERAL; case SOUTH_WEST: return SOUTH_WEST_LITERAL; case NORTH_SOUTH: return NORTH_SOUTH_LITERAL; case EAST_WEST: return EAST_WEST_LITERAL; case NSEW: return NSEW_LITERAL; } 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 Direction(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; } }