Package org.planit.utils.graph
Interface Vertex
-
- All Superinterfaces:
Comparable<Idable>,ExternalIdable,Idable,Serializable
- All Known Subinterfaces:
Centroid,DirectedVertex,Node
- All Known Implementing Classes:
CentroidImpl,DirectedVertexImpl,NodeImpl,VertexImpl
public interface Vertex extends Serializable, ExternalIdable
Vertex representation connected to one or more edges and/or edge segments- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanaddEdge(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.voidaddInputProperty(String key, Object value)Add a property from the original input that is not part of the readily available membersVertexclone()Clone the vertexCollection<? extends Edge>getEdges()Returns a collection of Edge objectsSet<Edge>getEdges(Vertex otherVertex)colect the edge(s) based on the other vertexintgetNumberOfEdges()Number of entries in edge segmentsorg.locationtech.jts.geom.PointgetPosition()Collect the geometry of the point location of this vertexbooleanremoveEdge(long edgeId)Remove edgebooleanremoveEdge(Edge edge)Remove edgedefault booleanreplace(Edge edgeToReplace, Edge edgeToReplaceWith, boolean forceInsert)replace one edge with the othervoidsetPosition(org.locationtech.jts.geom.Point position)Set the center point geometry for a vertexdefault voidtransformPosition(org.opengis.referencing.operation.MathTransform transformer)transform the position information of this vertex using the passed in MathTransformbooleanvalidate()validate the vertex regarding it connections to edges etc.-
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
-
-
-
-
Method Detail
-
addInputProperty
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
-
setPosition
void setPosition(org.locationtech.jts.geom.Point position)
Set the center point geometry for a vertex- Parameters:
position- the center point for a vertex
-
getPosition
org.locationtech.jts.geom.Point getPosition()
Collect the geometry of the point location of this vertex- Returns:
- direct position reflecting point location
-
addEdge
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.- Parameters:
edge- Edge to be added- Returns:
- true when added, false when already present (and not added)
-
removeEdge
boolean removeEdge(Edge edge)
Remove edge- Parameters:
edge- Edge to be removed- Returns:
- true when removed, false when not present (and not removed)
-
removeEdge
boolean removeEdge(long edgeId)
Remove edge- Parameters:
edgeId- Edge to be removed- Returns:
- true when removed, false when not present (and not removed)
-
getEdges
Collection<? extends Edge> getEdges()
Returns a collection of Edge objects- Returns:
- Set of Edge objects
-
getNumberOfEdges
int getNumberOfEdges()
Number of entries in edge segments- Returns:
- the number of edges connected to this vertex
-
getEdges
Set<Edge> getEdges(Vertex otherVertex)
colect the edge(s) based on the other vertex- Parameters:
otherVertex- that defines the edge(s)- Returns:
- edges for which this holds, if none hold an empty set is returned
-
clone
Vertex clone()
Clone the vertex- Returns:
- the cloned vertex
-
validate
boolean validate()
validate the vertex regarding it connections to edges etc.- Returns:
- true when valid, false otherwise
-
replace
default boolean replace(Edge edgeToReplace, Edge edgeToReplaceWith, boolean forceInsert)
replace one edge with the other- Parameters:
edgeToReplace- one to replaceedgeToReplaceWith- one to replace it withforceInsert- when true the replacement will be added event is original cannot be found, when false not- Returns:
- successful replacement/insert when true, false otherwise
-
transformPosition
default void transformPosition(org.opengis.referencing.operation.MathTransform transformer) throws org.opengis.geometry.MismatchedDimensionException, org.opengis.referencing.operation.TransformExceptiontransform the position information of this vertex using the passed in MathTransform- Parameters:
transformer- to apply- Throws:
org.opengis.geometry.MismatchedDimensionException- thrown if errororg.opengis.referencing.operation.TransformException- thrown if error
-
-