Interface Node

    • Field Detail

      • NODE_ID_CLASS

        static final Class<Node> NODE_ID_CLASS
        id class for generating ids
    • Method Detail

      • getNodeIdClass

        default Class<? extends Node> getNodeIdClass()
        Return class used to generate unique link ids via the id generator
        Returns:
        class type
      • generateNodeId

        default long generateNodeId​(IdGroupingToken tokenId)
        generate unique node id
        Parameters:
        tokenId - contiguous id generation within this group for instances of this class
        Returns:
        nodeId
      • getNodeId

        long getNodeId()
        Collect the id of the node. Not all vertices need to be nodes, this node id is contiguous and unique to the nodes in the network, but not necessarily across all vertices in the network
        Returns:
        node id
      • getName

        String getName()
        get the name of this node (if any)
        Returns:
        name of the node
      • setName

        void setName​(String name)
        set the name of the node
        Parameters:
        name - of the node
      • getLinks

        default <L extends EdgeCollection<L> getLinks()
        It is expected that nodes are used in conjunction with links. If so, this method will cast the edges of the node to a links collection for readability when collecting a node's edges
        Type Parameters:
        L - link type
        Returns:
        edges cast as collection of links
      • getEntryLinkSegments

        default <LS extends EdgeSegmentIterable<LS> getEntryLinkSegments()
        It is expected that nodes are used in conjunction with link segments. If so, this method will cast the edge segments of the node to link segments for readability when collecting node's edge segments
        Type Parameters:
        LS - edge segment type
        Returns:
        edgeSegments as collection of linkSegments
      • getExitLinkSegments

        default <LS extends EdgeSegmentIterable<LS> getExitLinkSegments()
        It is expected that nodes are used in conjunction with link segments. If so, this method will cast the edge segments of the node to link segments for readability when collecting node's edge segments
        Type Parameters:
        LS - edge segment type
        Returns:
        edgeSegments as collection of linkSegments
      • getLinkSegment

        default <LS extends EdgeSegment> LS getLinkSegment​(Node endNode)
        collect the first edge segment corresponding to the provided end node
        Type Parameters:
        LS - edge segment type
        Parameters:
        endNode - to use
        Returns:
        first edge segment matching this signature
      • getFirstEntryLinkSegment

        default <LS extends EdgeSegment> LS getFirstEntryLinkSegment()
        Collect the first available entry link segment using the iterator internally. It is assumed at least one entry is available
        Type Parameters:
        LS - link segment type used
        Returns:
        first entry available
      • getFirstExitLinkSegment

        default <LS extends EdgeSegment> LS getFirstExitLinkSegment()
        Collect the first available exit link segment using the iterator internally. It is assumed at least one entry is available
        Type Parameters:
        LS - link segment type used
        Returns:
        first exit available
      • hasLinks

        default boolean hasLinks()
        Check if node has links
        Returns:
        true when links are present, false otherwise