Package org.planit.graph
Class VertexImpl
- java.lang.Object
-
- org.planit.graph.VertexImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<Vertex>
,Vertex
- Direct Known Subclasses:
CentroidImpl
,NodeImpl
public class VertexImpl extends Object implements Vertex
Node representation connected to one or more entry and exit links- Author:
- markr
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VertexImpl.EdgeSegmentsImpl
EdgeSegment containerclass
VertexImpl.EdgesImpl
edges of this vertex-
Nested classes/interfaces inherited from interface org.planit.utils.graph.Vertex
Vertex.Edges, Vertex.EdgeSegments
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opengis.geometry.DirectPosition
centrePointGeometry
Centre point geometry which is coordinate reference system awareprotected Vertex.Edges
edges
edge containerprotected Vertex.EdgeSegments
entryEdgeSegments
entryEdgeSegment containerprotected Vertex.EdgeSegments
exitEdgeSegments
exitEdgeSegmentcontainerprotected long
id
Unique internal identifierprotected Map<String,Object>
inputProperties
generic input property storage
-
Constructor Summary
Constructors Modifier Constructor Description protected
VertexImpl(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available membersint
compareTo(Vertex o)
Compare vertices by their idprotected static int
generateVertexId(IdGroupingToken groupId)
generate unique node idorg.opengis.geometry.DirectPosition
getCentrePointGeometry()
Collect the geometry of the point location of this vertexVertex.Edges
getEdges()
#Collect the edges of this vertexVertex.EdgeSegments
getEntryEdgeSegments()
#Collect the entry edge segments of this vertexVertex.EdgeSegments
getExitEdgeSegments()
#Collect the exit edge segments of this vertexlong
getId()
#Return id of this instance.Object
getInputProperty(String key)
Get input property by its keyvoid
setCentrePointGeometry(org.opengis.geometry.DirectPosition centrePointGeometry)
#Set the center point geometry for a vertex
-
-
-
Field Detail
-
centrePointGeometry
protected org.opengis.geometry.DirectPosition centrePointGeometry
Centre point geometry which is coordinate reference system aware
-
id
protected final long id
Unique internal identifier
-
edges
protected final Vertex.Edges edges
edge container
-
exitEdgeSegments
protected final Vertex.EdgeSegments exitEdgeSegments
exitEdgeSegmentcontainer
-
entryEdgeSegments
protected final Vertex.EdgeSegments entryEdgeSegments
entryEdgeSegment container
-
-
Constructor Detail
-
VertexImpl
protected VertexImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
-
Method Detail
-
generateVertexId
protected static int generateVertexId(IdGroupingToken groupId)
generate unique node id- Parameters:
groupId
- , contiguous id generation within this group for instances of this class- Returns:
- nodeId
-
getCentrePointGeometry
public org.opengis.geometry.DirectPosition getCentrePointGeometry()
Collect the geometry of the point location of this vertex- Specified by:
getCentrePointGeometry
in interfaceVertex
- Returns:
- direct position reflecting point location
-
setCentrePointGeometry
public void setCentrePointGeometry(org.opengis.geometry.DirectPosition centrePointGeometry)
#Set the center point geometry for a vertex- Specified by:
setCentrePointGeometry
in interfaceVertex
- Parameters:
centrePointGeometry
- the center point for a vertex
-
getId
public long getId()
#Return id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator
-
addInputProperty
public void addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available members- Parameters:
key
- key (name) of the input propertyvalue
- value of the input property
-
getInputProperty
public Object getInputProperty(String key)
Get input property by its key- Parameters:
key
- the key of the input property- Returns:
- value the value of the input property
-
compareTo
public int compareTo(Vertex o)
Compare vertices by their id- Specified by:
compareTo
in interfaceComparable<Vertex>
- Parameters:
o
- Vertex object to be compared to this one- Returns:
- result of comparison
- See Also:
Comparable.compareTo(java.lang.Object)
-
getEntryEdgeSegments
public Vertex.EdgeSegments getEntryEdgeSegments()
#Collect the entry edge segments of this vertex- Specified by:
getEntryEdgeSegments
in interfaceVertex
- Returns:
- edgeSegments
-
getExitEdgeSegments
public Vertex.EdgeSegments getExitEdgeSegments()
#Collect the exit edge segments of this vertex- Specified by:
getExitEdgeSegments
in interfaceVertex
- Returns:
- edgeSegments
-
getEdges
public Vertex.Edges getEdges()
#Collect the edges of this vertex
-
-