Interface Node
-
- All Superinterfaces:
Comparable<IdAble>
,DirectedVertex
,ExternalIdAble
,GraphEntity
,IdAble
,ManagedId
,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
-
-
Field Summary
Fields Modifier and Type Field Description static Class<Node>
NODE_ID_CLASS
id class for generating ids-
Fields inherited from interface org.goplanit.utils.graph.directed.DirectedVertex
getEntryEdgeSegments, getExitEdgeSegments
-
Fields inherited from interface org.goplanit.utils.graph.Vertex
LOGGER, VERTEX_ID_CLASS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Node
deepClone()
Deep clonedefault long
generateNodeId(IdGroupingToken tokenId)
generate unique node iddefault <LS extends EdgeSegment>
Iterable<LS>getEntryLinkSegments()
It is expected that nodes are used in conjunction with link segments.default <LS extends EdgeSegment>
Iterable<LS>getExitLinkSegments()
It is expected that nodes are used in conjunction with link segments.default <LS extends EdgeSegment>
LSgetFirstEntryLinkSegment()
Collect the first available entry link segment using the iterator internally.default <LS extends EdgeSegment>
LSgetFirstExitLinkSegment()
Collect the first available exit link segment using the iterator internally.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.default Class<? extends Node>
getNodeIdClass()
Return class used to generate unique link ids via the id generatordefault boolean
hasLinks()
Check if node has linksvoid
setName(String name)
set the name of the nodeNode
shallowClone()
Shallow clone-
Methods inherited from interface org.goplanit.utils.graph.directed.DirectedVertex
getEdges, getEdgeSegment, getEntryEdgeSegments, getExitEdgeSegments, getNumberOfEntryEdgeSegments, getNumberOfExitEdgeSegments, hasEntryEdgeSegments, hasEntrySegment, hasExitEdgeSegments, hasExitSegment
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
Methods inherited from interface org.goplanit.utils.graph.Vertex
addEdge, addEdges, addInputProperty, getEdges, getIdClass, getInputProperty, getNumberOfEdges, getPosition, hasPosition, isPositionEqual2D, isPositionEqual2D, removeAllEdges, removeEdge, removeEdge, removeEdges, replace, setPosition, transformPosition, validate
-
-
-
-
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
-
shallowClone
Node shallowClone()
Shallow clone- Specified by:
shallowClone
in interfaceGraphEntity
- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceVertex
- Returns:
- the cloned entity
-
deepClone
Node deepClone()
Deep clone
-
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> Iterable<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> Iterable<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
-
-