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 classVertexImpl.EdgeSegmentsImplEdgeSegment containerclassVertexImpl.EdgesImpledges 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.DirectPositioncentrePointGeometryCentre point geometry which is coordinate reference system awareprotected Vertex.Edgesedgesedge containerprotected Vertex.EdgeSegmentsentryEdgeSegmentsentryEdgeSegment containerprotected Vertex.EdgeSegmentsexitEdgeSegmentsexitEdgeSegmentcontainerprotected longidUnique internal identifierprotected Map<String,Object>inputPropertiesgeneric input property storage
-
Constructor Summary
Constructors Modifier Constructor Description protectedVertexImpl(IdGroupingToken groupId)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInputProperty(String key, Object value)Add a property from the original input that is not part of the readily available membersintcompareTo(Vertex o)Compare vertices by their idprotected static intgenerateVertexId(IdGroupingToken groupId)generate unique node idorg.opengis.geometry.DirectPositiongetCentrePointGeometry()Collect the geometry of the point location of this vertexVertex.EdgesgetEdges()#Collect the edges of this vertexVertex.EdgeSegmentsgetEntryEdgeSegments()#Collect the entry edge segments of this vertexVertex.EdgeSegmentsgetExitEdgeSegments()#Collect the exit edge segments of this vertexlonggetId()#Return id of this instance.ObjectgetInputProperty(String key)Get input property by its keyvoidsetCentrePointGeometry(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:
getCentrePointGeometryin 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:
setCentrePointGeometryin 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:
compareToin 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:
getEntryEdgeSegmentsin interfaceVertex- Returns:
- edgeSegments
-
getExitEdgeSegments
public Vertex.EdgeSegments getExitEdgeSegments()
#Collect the exit edge segments of this vertex- Specified by:
getExitEdgeSegmentsin interfaceVertex- Returns:
- edgeSegments
-
getEdges
public Vertex.Edges getEdges()
#Collect the edges of this vertex
-
-