Class DetachedEdge

  • All Implemented Interfaces:
    Serializable, Edge, Element, Attachable<Edge>

    public class DetachedEdge
    extends DetachedElement<Edge>
    implements Edge
    Represents an Edge that is disconnected from a Graph. "Disconnection" can mean detachment from a Graph in the sense that the Edge was constructed from a Graph instance and this reference was removed or it can mean that the DetachedEdge could have been constructed independently of a Graph instance in the first place.

    A DetachedEdge only has reference to the properties and in/out vertices that are associated with it at the time of detachment (or construction) and is not traversable or mutable. Note that the references to the in/out vertices are DetachedVertex instances that only have reference to the Element.id() and Element.label().

    Author:
    Stephen Mallette (http://stephen.genoprime.com), Marko A. Rodriguez (http://markorodriguez.com)
    See Also:
    Serialized Form
    • Method Detail

      • 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
      • 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
      • 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
      • remove

        public void remove()
        Description copied from interface: Element
        Removes the Element from the graph.
        Specified by:
        remove in interface Element