Class AbstractGraph.SimpleEdge

    • Method Detail

      • getId

        public final Optional<ID> getId()
        Description copied from interface: Graph.Edge
        Returns optional identifier of this edge.
        Specified by:
        getId in interface Graph.Edge<ID>
        Returns:
        optional identifier
      • setId

        public void setId​(ID id)
        Description copied from interface: Graph.Edge
        Sets identifier of this edge.
        Specified by:
        setId in interface Graph.Edge<ID>
        Parameters:
        id - of edge
      • id

        public final Graph.Edge<ID> id​(ID id)
        Description copied from interface: Graph.Edge
        Sets identifier of this edge.
        Specified by:
        id in interface Graph.Edge<ID>
        Parameters:
        id - of edge
        Returns:
        this edge
      • getFrom

        public final ID getFrom()
        Description copied from interface: Graph.Edge
        Returns vertex id of 'from' endpoint.
        Specified by:
        getFrom in interface Graph.Edge<ID>
        Returns:
        id of 'from' endpoint
      • setFrom

        public void setFrom​(ID from)
        Description copied from interface: Graph.Edge
        Sets vertex id of 'from' endpoint. If vertex does not exist it is created.
        Specified by:
        setFrom in interface Graph.Edge<ID>
        Parameters:
        from - endpoint
      • from

        public Graph.Edge<ID> from​(ID from)
        Description copied from interface: Graph.Edge
        Sets vertex id of 'from' endpoint. If vertex does not exist it is created.
        Specified by:
        from in interface Graph.Edge<ID>
        Parameters:
        from - endpoint
        Returns:
        this edge
      • from

        public final ID from()
        Description copied from interface: Graph.Edge
        Returns vertex id of 'from' endpoint.
        Specified by:
        from in interface Graph.Edge<ID>
        Returns:
        id of 'from' endpoint
      • getTo

        public final ID getTo()
        Description copied from interface: Graph.Edge
        Returns vertex id of 'to' endpoint.
        Specified by:
        getTo in interface Graph.Edge<ID>
        Returns:
        id of 'to' endpoint
      • setTo

        public void setTo​(ID to)
        Description copied from interface: Graph.Edge
        Sets vertex id of 'to' endpoint. If vertex does not exist it is created.
        Specified by:
        setTo in interface Graph.Edge<ID>
        Parameters:
        to - endpoint
      • to

        public final Graph.Edge<ID> to​(ID to)
        Description copied from interface: Graph.Edge
        Sets vertex id of 'to' endpoint. If vertex does not exist it is created.
        Specified by:
        to in interface Graph.Edge<ID>
        Parameters:
        to - endpoint
        Returns:
        this edge
      • to

        public final ID to()
        Description copied from interface: Graph.Edge
        Returns vertex id of 'to' endpoint.
        Specified by:
        to in interface Graph.Edge<ID>
        Returns:
        id of 'to' endpoint
      • isDirected

        public final boolean isDirected()
        Description copied from interface: Graph.Edge
        Returns true if this edge is directed. This edge is always directed if the parent graph is directed.
        Specified by:
        isDirected in interface Graph.Edge<ID>
        Returns:
        true if this edge is directed
      • endpoints

        public final List<ID> endpoints()
        Description copied from interface: Graph.Edge
        Returns ordered pair of endpoint ids. 'from' endpoint id is always first followed by 'to' endpoint id.
        Specified by:
        endpoints in interface Graph.Edge<ID>
        Returns:
        order pair of endpoints
      • setProperty

        public void setProperty​(String name,
                                Object value)
        Adds a local property to this element.
        Specified by:
        setProperty in interface Graph.Edge<ID>
        Parameters:
        name - of property
        value - of property
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • inherited

        public final Map<String,​Object> inherited()
        Returns inherited properties as an unmodifiableMap.
        Returns:
        inherited properties
      • local

        public final Map<String,​Object> local()
        Returns an unmodifiable Map of all properties set on this Element.
        Returns:
        all properties set on this element
      • getProperty

        public final Optional<Object> getProperty​(String name)
        Returns the value of a property. If the property is local its value is returned before checking for an inherited property.
        Parameters:
        name - of property to return
        Returns:
        value mapped to name
        Throws:
        NullPointerException - if name is null
      • property

        public final SELF property​(String name,
                                   Object value)
        Adds a local property to this element returning it.
        Parameters:
        name - of property
        value - of property
        Returns:
        this element