Package org.planit.utils.graph
Interface Edge
-
- All Superinterfaces:
Comparable<Idable>
,ExternalIdable
,Idable
,Serializable
- All Known Subinterfaces:
ConnectoidEdge
,DirectedEdge
,Link
- All Known Implementing Classes:
ConnectoidEdgeImpl
,DirectedEdgeImpl
,EdgeImpl
,LinkImpl
public interface Edge extends Serializable, ExternalIdable
Edge interface connecting two vertices in a non-directional fashion.- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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 link membersEdge
clone()
Clone the edge as is, all shared members are shallow copied, fully owned members are deep copiedorg.locationtech.jts.geom.LineString
getGeometry()
Collect the geometry of this lineObject
getInputProperty(String key)
Get input property by its keydouble
getLengthKm()
Return length of this edge in kmString
getName()
get the name of the edgeVertex
getVertexA()
Vertex A of the edgeVertex
getVertexB()
Vertex B of the edgedefault boolean
hasGeometry()
check if geometry is availabledefault boolean
hasVertex(Vertex vertex)
check if vertex is present on the edgedefault boolean
isGeometryInAbDirection()
verify if the geometry is in the A to B direction of the linkboolean
removeVertex(Vertex vertex)
Remove vertex from edgeboolean
replace(Vertex vertextoReplace, Vertex vertexToReplaceWith)
Replace one of the vertices of the linkvoid
setGeometry(org.locationtech.jts.geom.LineString lineString)
set the geometry of this link as a line stringvoid
setLengthKm(double lengthInKm)
set length of this edge in kmvoid
setName(String name)
set the name of the edgedefault void
transformGeometry(org.opengis.referencing.operation.MathTransform transformer)
transform the line string information of this edge using the passed in MathTransformboolean
validate()
validate the contents of this edge-
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
-
getGeometry
org.locationtech.jts.geom.LineString getGeometry()
Collect the geometry of this line- Returns:
- lineString
-
setGeometry
void setGeometry(org.locationtech.jts.geom.LineString lineString)
set the geometry of this link as a line string- Parameters:
lineString
- to set
-
hasGeometry
default boolean hasGeometry()
check if geometry is available- Returns:
- true when available, false otherwise
-
isGeometryInAbDirection
default boolean isGeometryInAbDirection()
verify if the geometry is in the A to B direction of the link- Returns:
- true if in A to B direction, false otherwise
-
transformGeometry
default void transformGeometry(org.opengis.referencing.operation.MathTransform transformer) throws org.opengis.geometry.MismatchedDimensionException, org.opengis.referencing.operation.TransformException
transform the line string information of this edge using the passed in MathTransform- Parameters:
transformer
- to apply- Throws:
org.opengis.geometry.MismatchedDimensionException
- thrown if errororg.opengis.referencing.operation.TransformException
- thrown if error
-
removeVertex
boolean removeVertex(Vertex vertex)
Remove vertex from edge- Parameters:
vertex
- to remove- Returns:
- true when successful false otherwise
-
getVertexA
Vertex getVertexA()
Vertex A of the edge- Returns:
- vertex A
-
getVertexB
Vertex getVertexB()
Vertex B of the edge- Returns:
- vertex B
-
setName
void setName(String name)
set the name of the edge- Parameters:
name
- to set
-
getName
String getName()
get the name of the edge- Returns:
- name
-
setLengthKm
void setLengthKm(double lengthInKm)
set length of this edge in km- Parameters:
lengthInKm
- of this edge in km
-
getLengthKm
double getLengthKm()
Return length of this edge in km- Returns:
- length of this edge in km
-
addInputProperty
void addInputProperty(String key, Object value)
Add a property from the original input that is not part of the readily available link members- Parameters:
key
- (name) of input propertyvalue
- of input property
-
getInputProperty
Object getInputProperty(String key)
Get input property by its key- Parameters:
key
- of input property- Returns:
- value retrieved value of input property
-
replace
boolean replace(Vertex vertextoReplace, Vertex vertexToReplaceWith) throws PlanItException
Replace one of the vertices of the link- Parameters:
vertextoReplace
- the vertex to replacevertexToReplaceWith
- the vertex to replace with- Returns:
- true when replaced, false otherwise
- Throws:
PlanItException
- thrown if error
-
clone
Edge clone()
Clone the edge as is, all shared members are shallow copied, fully owned members are deep copied- Returns:
- copy of this edge
-
validate
boolean validate()
validate the contents of this edge- Returns:
- true when valid, false otherwise
-
hasVertex
default boolean hasVertex(Vertex vertex)
check if vertex is present on the edge- Parameters:
vertex
- to check- Returns:
- true when present false otherwise
-
-