@ Pure public boolean isConnectableTo ( RoadPath path ) { assert path != null ; if ( path . isEmpty ( ) ) { return false ; } RoadConnection first1 = getFirstPoint ( ) ; RoadConnection last1 = getLastPoint ( ) ; first1 = first1 . getWrappedRoadConnection ( ) ; last1 = last1 . getWrappedRoadConnection ( ) ; RoadConnection first2 = path . getFirstPoint ( ) ; RoadConnection last2 = path . getLastPoint ( ) ; first2 = first2 . getWrappedRoadConnection ( ) ; last2 = last2 . getWrappedRoadConnection ( ) ; return first1 . equals ( first2 ) || first1 . equals ( last2 ) || last1 . equals ( first2 ) || last1 . equals ( last2 ) ; }
Replies if the given road path is connectable to this road path .