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>connectionWrapped 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 intcompareTo(Point2D<?,?> pts)Compares this object with the specified point for order.intcompareTo(GraphPoint<RoadConnection,RoadSegment> point)booleanequals(Object obj)GeoLocationPointgetGeoLocation()Replies the geographic coordinates of this road connection.Point2dgetPoint()Replies the coordinates of this road connection.UUIDgetUUID()Replies an unique identifier for element.RoadConnectiongetWrappedRoadConnection()Replies the wrapped road connection if this object is a wrapper to another road connection.inthashCode()booleanisEmpty()Replies if this connection has no connected segment.booleanisFinalConnectionPoint()Replies if this point is a final connection point ie, a point connected to only one segment.booleanisNearPoint(Point2D<?,?> point)Replies if the specified point is near this connection point.booleanisReallyCulDeSac()Replies if this point is a cul-de-sac.StringtoString()-
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:RoadConnectionReplies 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:
getWrappedRoadConnectionin interfaceRoadConnection- Returns:
- the wrapped road connection or this road connection itself.
-
getPoint
@Pure public final Point2d getPoint()
Description copied from interface:RoadConnectionReplies the coordinates of this road connection.- Specified by:
getPointin interfaceRoadConnection- Returns:
- the coordinates of this road connection.
-
getGeoLocation
@Pure public final GeoLocationPoint getGeoLocation()
Description copied from interface:RoadConnectionReplies the geographic coordinates of this road connection.- Specified by:
getGeoLocationin interfaceRoadConnection- Returns:
- the geographic coordinates of this road connection.
-
getUUID
@Pure public final UUID getUUID()
Description copied from interface:RoadConnectionReplies an unique identifier for element.A Unique IDentifier (UID) must be unique for all the object instances.
- Specified by:
getUUIDin interfaceRoadConnection- Returns:
- the identifier
-
isNearPoint
@Pure public final boolean isNearPoint(Point2D<?,?> point)
Description copied from interface:RoadConnectionReplies if the specified point is near this connection point.- Specified by:
isNearPointin interfaceRoadConnection- Parameters:
point- is the point to test- Returns:
trueif the point is near this connection, otherwise false.
-
compareTo
@Pure public final int compareTo(GraphPoint<RoadConnection,RoadSegment> point)
- Specified by:
compareToin interfaceComparable<GraphPoint<RoadConnection,RoadSegment>>
-
compareTo
@Pure public final int compareTo(Point2D<?,?> pts)
Description copied from interface:RoadConnectionCompares 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:
compareToin 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:RoadConnectionReplies if this connection has no connected segment.- Specified by:
isEmptyin interfaceRoadConnection- Returns:
trueif this object has no connected segment, otherwisefalse
-
isFinalConnectionPoint
@Pure public boolean isFinalConnectionPoint()
Description copied from interface:RoadConnectionReplies 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 truetruetrue n false n/a falsefalsetrue 1 true 1 truetruetrue n true 1 truefalsetrue n true m<=n falsefalse- Specified by:
isFinalConnectionPointin interfaceGraphPoint<RoadConnection,RoadSegment>- Specified by:
isFinalConnectionPointin interfaceRoadConnection- Returns:
trueif zero or one segment was connected to this point, otherwisefalse- See Also:
RoadConnection.isReallyCulDeSac()
-
isReallyCulDeSac
@Pure public final boolean isReallyCulDeSac()
Description copied from interface:RoadConnectionReplies 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 truetruetrue n false n/a falsefalsetrue 1 true 1 truetruetrue n true 1 truefalsetrue n true m<=n falsefalse- Specified by:
isReallyCulDeSacin interfaceRoadConnection- Returns:
trueif zero or one segment was connected to this point, otherwisefalse- See Also:
RoadConnection.isFinalConnectionPoint()
-
-