Package org.goplanit.graph
Class VertexImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.graph.GraphEntityImpl
-
- org.goplanit.graph.VertexImpl
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IdAble>
,GraphEntity
,Vertex
,ExternalIdAble
,IdAble
,ManagedId
- Direct Known Subclasses:
DirectedVertexImpl
public class VertexImpl extends GraphEntityImpl implements Vertex
Vertex representation connected to one or more entry and exit edges- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Long,Edge>
edges
Edges of this vertexprotected Map<String,Object>
inputProperties
generic input property storageprotected org.locationtech.jts.geom.Point
position
Position of the vertex-
Fields inherited from interface org.goplanit.utils.graph.Vertex
LOGGER, VERTEX_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
VertexImpl(VertexImpl vertexImpl)
Copy constructor.protected
VertexImpl(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdge(Edge edge)
Add edge, do not invoke when parsing networks, this connection is auto-populated before the assignment starts based on the edge and its two vertices that have been registered.void
addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available membersVertexImpl
clone()
Create a shallow copy of this entityCollection<Edge>
getEdges()
Returns a collection of Edge objects (unmodifiable)Object
getInputProperty(String key)
collect a propertyorg.locationtech.jts.geom.Point
getPosition()
#Collect the geometry of the point location of this vertexboolean
removeEdge(long edgeId)
Remove edgevoid
setPosition(org.locationtech.jts.geom.Point position)
#Set the center point geometry for a vertex-
Methods inherited from class org.goplanit.graph.GraphEntityImpl
generateAndSetId, generateId, recreateManagedIds, toString
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, 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
getEdges, getIdClass, getNumberOfEdges, hasPosition, isPositionEqual2D, removeEdge, replace, transformPosition, validate
-
-
-
-
Constructor Detail
-
VertexImpl
protected VertexImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
VertexImpl
protected VertexImpl(VertexImpl vertexImpl)
Copy constructor. Geometry and input properties are deep copied, edges are not because they are not owned by this class by the vertex.- Parameters:
vertexImpl
- to copy
-
-
Method Detail
-
getPosition
public org.locationtech.jts.geom.Point getPosition()
#Collect the geometry of the point location of this vertex- Specified by:
getPosition
in interfaceVertex
- Returns:
- direct position reflecting point location
-
setPosition
public void setPosition(org.locationtech.jts.geom.Point position)
#Set the center point geometry for a vertex- Specified by:
setPosition
in interfaceVertex
- Parameters:
position
- the center point for a vertex
-
addInputProperty
public void addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available members- Specified by:
addInputProperty
in interfaceVertex
- Parameters:
key
- key (name) of the input propertyvalue
- value of the input property
-
getInputProperty
public Object getInputProperty(String key)
collect a property- Specified by:
getInputProperty
in interfaceVertex
- Parameters:
key
- for the property- Returns:
- property itself
-
addEdge
public boolean addEdge(Edge edge)
Add edge, do not invoke when parsing networks, this connection is auto-populated before the assignment starts based on the edge and its two vertices that have been registered.
-
removeEdge
public boolean removeEdge(long edgeId)
Remove edge- Specified by:
removeEdge
in interfaceVertex
- Parameters:
edgeId
- Edge to be removed- Returns:
- true when removed, false when not present (and not removed)
-
getEdges
public Collection<Edge> getEdges()
Returns a collection of Edge objects (unmodifiable)
-
clone
public VertexImpl clone()
Create a shallow copy of this entity
-
-