Class AbstractWrapRoadConnection
- java.lang.Object
-
- org.arakhne.afc.gis.road.primitive.AbstractWrapRoadConnection
-
- All Implemented Interfaces:
Comparable<GraphPoint<RoadConnection,RoadSegment>>
,RoadConnection
,GraphPoint<RoadConnection,RoadSegment>
- Direct Known Subclasses:
ExclusionRoadConnection
,SubRoadNetwork.AbstractWrapConnection
public abstract class AbstractWrapRoadConnection extends Object implements RoadConnection
This class provides the base implementation of a road connection wrapped to an other road connection.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:55
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroad
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.graph.GraphPoint
GraphPoint.GraphPointConnection<PT extends GraphPoint<PT,ST>,ST extends GraphSegment<ST,PT>>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.gis.road.primitive.RoadConnection
RoadConnection.ClockwiseBoundType
-
-
Field Summary
Fields Modifier and Type Field Description protected SoftReference<RoadConnection>
connection
Wrapped road connection.-
Fields inherited from interface org.arakhne.afc.gis.road.primitive.RoadConnection
DEFAULT_CLOCKWHISE_TYPE
-
-
Constructor Summary
Constructors Constructor Description AbstractWrapRoadConnection(RoadConnection con)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Point2D<?,?> pts)
Compares this object with the specified point for order.int
compareTo(GraphPoint<RoadConnection,RoadSegment> point)
boolean
equals(Object obj)
GeoLocationPoint
getGeoLocation()
Replies the geographic coordinates of this road connection.Point2d
getPoint()
Replies the coordinates of this road connection.UUID
getUUID()
Replies an unique identifier for element.RoadConnection
getWrappedRoadConnection()
Replies the wrapped road connection if this object is a wrapper to another road connection.int
hashCode()
boolean
isEmpty()
Replies if this connection has no connected segment.boolean
isFinalConnectionPoint()
Replies if this point is a final connection point ie, a point connected to only one segment.boolean
isNearPoint(Point2D<?,?> point)
Replies if the specified point is near this connection point.boolean
isReallyCulDeSac()
Replies if this point is a cul-de-sac.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.math.graph.GraphPoint
getConnectedSegmentsStartingFromInReverseOrder, getConnections, getConnectionsStartingFrom, getConnectionsStartingFromInReverseOrder
-
Methods inherited from interface org.arakhne.afc.gis.road.primitive.RoadConnection
getConnectedSegment, getConnectedSegmentCount, getConnectedSegments, getConnectedSegmentsStartingFrom, getOtherSideSegment, isConnectedSegment, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toClockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator, toCounterclockwiseIterator
-
-
-
-
Field Detail
-
connection
protected SoftReference<RoadConnection> connection
Wrapped road connection.
-
-
Constructor Detail
-
AbstractWrapRoadConnection
public AbstractWrapRoadConnection(RoadConnection con)
Constructor.- Parameters:
con
- is the wrapped connection.
-
-
Method Detail
-
getWrappedRoadConnection
@Pure public final RoadConnection getWrappedRoadConnection()
Description copied from interface:RoadConnection
Replies the wrapped road connection if this object is a wrapper to another road connection. If this object is not a wrapper to another road connection, relies this object iteself.- Specified by:
getWrappedRoadConnection
in interfaceRoadConnection
- Returns:
- the wrapped road connection or this road connection itself.
-
getPoint
@Pure public final Point2d getPoint()
Description copied from interface:RoadConnection
Replies the coordinates of this road connection.- Specified by:
getPoint
in interfaceRoadConnection
- Returns:
- the coordinates of this road connection.
-
getGeoLocation
@Pure public final GeoLocationPoint getGeoLocation()
Description copied from interface:RoadConnection
Replies the geographic coordinates of this road connection.- Specified by:
getGeoLocation
in interfaceRoadConnection
- Returns:
- the geographic coordinates of this road connection.
-
getUUID
@Pure public final UUID getUUID()
Description copied from interface:RoadConnection
Replies an unique identifier for element.A Unique IDentifier (UID) must be unique for all the object instances.
- Specified by:
getUUID
in interfaceRoadConnection
- Returns:
- the identifier
-
isNearPoint
@Pure public final boolean isNearPoint(Point2D<?,?> point)
Description copied from interface:RoadConnection
Replies if the specified point is near this connection point.- Specified by:
isNearPoint
in interfaceRoadConnection
- Parameters:
point
- is the point to test- Returns:
true
if the point is near this connection, otherwise false.
-
compareTo
@Pure public final int compareTo(GraphPoint<RoadConnection,RoadSegment> point)
- Specified by:
compareTo
in interfaceComparable<GraphPoint<RoadConnection,RoadSegment>>
-
compareTo
@Pure public final int compareTo(Point2D<?,?> pts)
Description copied from interface:RoadConnection
Compares this object with the specified point for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified point.- Specified by:
compareTo
in interfaceRoadConnection
- Parameters:
pts
- is the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified point.
-
isEmpty
@Pure public final boolean isEmpty()
Description copied from interface:RoadConnection
Replies if this connection has no connected segment.- Specified by:
isEmpty
in interfaceRoadConnection
- Returns:
true
if this object has no connected segment, otherwisefalse
-
isFinalConnectionPoint
@Pure public boolean isFinalConnectionPoint()
Description copied from interface:RoadConnection
Replies if this point is a final connection point ie, a point connected to only one segment.The difference between
RoadConnection.isReallyCulDeSac()
andRoadConnection.isFinalConnectionPoint()
is on the treatement of sub-road-network elements.RoadConnection.isFinalConnectionPoint()
takes into account only the current (sub)-road network.RoadConnection.isReallyCulDeSac()
takes into account only the top-most road network element. See the following table for details:Inside RoadNetwork # Connected Segments at Top-Level Inside SubRoadNetwork # Connected Segments at Lower-Level isFinalConnectionPoint isReallyCulDeSac true 1 false n/a true
true
true n false n/a false
false
true 1 true 1 true
true
true n true 1 true
false
true n true m<=n false
false
- Specified by:
isFinalConnectionPoint
in interfaceGraphPoint<RoadConnection,RoadSegment>
- Specified by:
isFinalConnectionPoint
in interfaceRoadConnection
- Returns:
true
if zero or one segment was connected to this point, otherwisefalse
- See Also:
RoadConnection.isReallyCulDeSac()
-
isReallyCulDeSac
@Pure public final boolean isReallyCulDeSac()
Description copied from interface:RoadConnection
Replies if this point is a cul-de-sac.The difference between
RoadConnection.isReallyCulDeSac()
andRoadConnection.isFinalConnectionPoint()
is on the treatement of sub-road-network elements.RoadConnection.isFinalConnectionPoint()
takes into account only the current (sub)-road network.RoadConnection.isReallyCulDeSac()
takes into account only the top-most road network element. See the following table for details:Inside RoadNetwork # Connected Segments at Top-Level Inside SubRoadNetwork # Connected Segments at Lower-Level isFinalConnectionPoint isReallyCulDeSac true 1 false n/a true
true
true n false n/a false
false
true 1 true 1 true
true
true n true 1 true
false
true n true m<=n false
false
- Specified by:
isReallyCulDeSac
in interfaceRoadConnection
- Returns:
true
if zero or one segment was connected to this point, otherwisefalse
- See Also:
RoadConnection.isFinalConnectionPoint()
-
-