org.apache.tinkerpop.gremlin.structure

## Enum Direction

- java.lang.Object
- - java.lang.Enum<Direction>
  - - org.apache.tinkerpop.gremlin.structure.Direction

- All Implemented Interfaces:
    Serializable, Comparable<Direction>

      public enum Direction
      extends Enum<Direction>

  `Direction` is used to denote the direction of an `Edge` or location of a `Vertex` on an `Edge`. For example:

       gremlin--knows-->rexster

  is an `OUT` `Edge` for Gremlin and an `IN` edge for Rexster. Moreover, given that `Edge`, Gremlin is the `OUT` `Vertex` and Rexster is the `IN` `Vertex`.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BOTH` Refers to either direction (`IN` or `OUT`).
    `IN` Refers to an incoming direction.
    `OUT` Refers to an outgoing direction.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Direction[]` | `proper` The actual direction of an `Edge` may only be `IN` or `OUT`, as defined in this array.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Direction` | `opposite()` Produce the opposite representation of the current `Direction` enum.
    `static Direction` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static Direction[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### OUT

          public static final Direction OUT

      Refers to an outgoing direction.

    - #### IN

          public static final Direction IN

      Refers to an incoming direction.

    - #### BOTH

          public static final Direction BOTH

      Refers to either direction (`IN` or `OUT`).

  - ### Field Detail

    - #### proper

          public static final Direction[] proper

      The actual direction of an `Edge` may only be `IN` or `OUT`, as defined in this array.

  - ### Method Detail

    - #### values

          public static Direction[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Direction c : Direction.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Direction valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### opposite

          public Direction opposite()

      Produce the opposite representation of the current `Direction` enum.

Copyright © 2013–2021 Apache Software Foundation. All rights reserved.