Interface EdgeDraft

  • All Superinterfaces:
    ElementDraft

    public interface EdgeDraft
    extends ElementDraft
    Draft edge, hosted by import containers to represent edges found when importing. Processors decide if this edge will finally be appended to the graph or not.
    Author:
    Mathieu Bastian
    See Also:
    ContainerLoader
    • Method Detail

      • getWeight

        double getWeight()
        Returns this edge's weight.
        Returns:
        edge's weight
      • setWeight

        void setWeight​(double weight)
        Sets this edge's weight.

        Default is 1.0.

        Parameters:
        weight - edge's weight
      • getType

        Object getType()
        Gets this edge's type.

        Edges can have different types but by default all edges have a default, null type. In other words, setting a type is optional.

        Returns:
        edge's type or null if unset
      • setType

        void setType​(Object type)
        Sets this edge's type.

        Edges can have different types but by default all edges have a default, null type. In other words, setting a type is optional.

        Parameters:
        type - edge type
      • getDirection

        EdgeDirection getDirection()
        Returns this edge's direction setting.
        Returns:
        edge's direction or null if unset
      • setDirection

        void setDirection​(EdgeDirection direction)
        Sets this edge's direction setting.
        Parameters:
        direction - edge's direction
      • getSource

        NodeDraft getSource()
        Get edge's source.
        Returns:
        edge's source or null if unset
      • setSource

        void setSource​(NodeDraft nodeSource)
        Sets this edge's source.
        Parameters:
        nodeSource - node source
      • getTarget

        NodeDraft getTarget()
        Get edge's target.
        Returns:
        edge's target or null if unset
      • setTarget

        void setTarget​(NodeDraft nodeTarget)
        Sets this edge's target.

        Self-loops should simply set both source and target with the same node.

        Parameters:
        nodeTarget - node target
      • isSelfLoop

        boolean isSelfLoop()
        Returns true if this edge is a self-loop.

        It returns false if the source or target is null.

        Returns:
        true if self-loop, false otherwise