Interface Node
-
- All Superinterfaces:
Comparable<Idable>
,DirectedVertex
,ExternalIdable
,Idable
,Serializable
,Vertex
- All Known Implementing Classes:
NodeImpl
public interface Node extends DirectedVertex
Node is a vertex but not all vertices are nodes. Nodes represent locations in the physical network where links intersect, usually representing junctions or intersections- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <LS extends EdgeSegment>
Set<LS>getEntryLinkSegments()
It is expected that nodes are used in conjunction with link segments.default <LS extends EdgeSegment>
Set<LS>getExitLinkSegments()
It is expected that nodes are used in conjunction with link segments.default <L extends Edge>
Collection<L>getLinks()
It is expected that nodes are used in conjunction with links.default <LS extends EdgeSegment>
LSgetLinkSegment(Node endNode)
collect the first edge segment corresponding to the provided end nodeString
getName()
get the name of this node (if any)long
getNodeId()
Collect the id of the node.void
setName(String name)
set the name of the node-
Methods inherited from interface org.planit.utils.graph.DirectedVertex
addEdgeSegment, getEdgeSegment, getEntryEdgeSegments, getExitEdgeSegments, getNumberOfEntryEdgeSegments, getNumberOfExitEdgeSegments, hasEntryEdgeSegments, hasExitEdgeSegments, removeEdgeSegment, replace
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.planit.utils.graph.Vertex
addEdge, addInputProperty, clone, getEdges, getEdges, getNumberOfEdges, getPosition, removeEdge, removeEdge, replace, setPosition, transformPosition, validate
-
-
-
-
Method Detail
-
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 Edge> Collection<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 EdgeSegment> Set<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 EdgeSegment> Set<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
-
-