org.apache.tinkerpop.gremlin.tinkergraph.structure

## Class TinkerEdge

- java.lang.Object
- - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement
  - - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge

- All Implemented Interfaces:
    Edge, Element

      public final class TinkerEdge
      extends TinkerElement
      implements Edge

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `Edge.Exceptions`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Vertex` | `inVertex`
    `protected Vertex` | `outVertex`
    `protected Map<String,Property>` | `properties`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement

      `id, label, removed`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `DEFAULT_LABEL`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TinkerEdge(Object id, Vertex outVertex, String label, Vertex inVertex)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Graph` | `graph()` Get the graph that this element is within.
    `Vertex` | `inVertex()` Get the incoming/head vertex of this edge.
    `Set<String>` | `keys()` Get the keys of the properties associated with this element.
    `Vertex` | `outVertex()` Get the outgoing/tail vertex of this edge.
    `<V> Iterator<Property<V>>` | `properties(String... propertyKeys)` Get an `Iterator` of properties where the `propertyKeys` is meant to be a filter on the available keys.
    `<V> Property<V>` | `property(String key)` Get a `Property` for the `Element` given its key.
    `<V> Property<V>` | `property(String key, V value)` Add or set a property value for the `Element` given its key.
    `void` | `remove()` Removes the `Element` from the graph.
    `String` | `toString()`
    `Iterator<Vertex>` | `vertices(Direction direction)` Retrieve the vertex (or vertices) associated with this edge as defined by the direction.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement

      `elementAlreadyRemoved, equals, hashCode, id, label`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `bothVertices`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Element

      `id, label, value, values`

- - ### Field Detail

    - #### properties

          protected Map<String,Property> properties

    - #### inVertex

          protected final Vertex inVertex

    - #### outVertex

          protected final Vertex outVertex

  - ### Constructor Detail

    - #### TinkerEdge

          protected TinkerEdge(Object id,
                               Vertex outVertex,
                               String label,
                               Vertex inVertex)

  - ### Method Detail

    - #### property

          public <V> Property<V> property(String key,
                                          V value)

      Description copied from interface: `Element`
      Add or set a property value for the `Element` given its key.
      Specified by:
        `property` in interface `Element`

    - #### property

          public <V> Property<V> property(String key)

      Description copied from interface: `Element`
      Get a `Property` for the `Element` given its key. The default implementation calls the raw `Element.properties(java.lang.String...)`.
      Specified by:
        `property` in interface `Element`

    - #### keys

          public Set<String> keys()

      Description copied from interface: `Element`
      Get the keys of the properties associated with this element. The default implementation iterators the properties and stores the keys into a `HashSet`.
      Specified by:
        `keys` in interface `Element`
      Returns:
        The property key set

    - #### remove

          public void remove()

      Description copied from interface: `Element`
      Removes the `Element` from the graph.
      Specified by:
        `remove` in interface `Element`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### outVertex

          public Vertex outVertex()

      Description copied from interface: `Edge`
      Get the outgoing/tail vertex of this edge.
      Specified by:
        `outVertex` in interface `Edge`
      Returns:
        the outgoing vertex of the edge

    - #### inVertex

          public Vertex inVertex()

      Description copied from interface: `Edge`
      Get the incoming/head vertex of this edge.
      Specified by:
        `inVertex` in interface `Edge`
      Returns:
        the incoming vertex of the edge

    - #### vertices

          public Iterator<Vertex> vertices(Direction direction)

      Description copied from interface: `Edge`
      Retrieve the vertex (or vertices) associated with this edge as defined by the direction. If the direction is `Direction.BOTH` then the iterator order is: `Direction.OUT` then `Direction.IN`.
      Specified by:
        `vertices` in interface `Edge`
      Parameters:
        `direction` - Get the incoming vertex, outgoing vertex, or both vertices
      Returns:
        An iterator with 1 or 2 vertices

    - #### graph

          public Graph graph()

      Description copied from interface: `Element`
      Get the graph that this element is within.
      Specified by:
        `graph` in interface `Element`
      Returns:
        the graph of this element

    - #### properties

          public <V> Iterator<Property<V>> properties(String... propertyKeys)

      Description copied from interface: `Edge`
      Get an `Iterator` of properties where the `propertyKeys` is meant to be a filter on the available keys. If no keys are provide then return all the properties.
      Specified by:
        `properties` in interface `Edge`
      Specified by:
        `properties` in interface `Element`

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