@@ -859,11 +859,11 @@ public void addConnectivityListener(ConnectivityListener listener) {
859859 * @param listener The listener to register.
860860 * @param directed The orientation of links to be listened, as a boolean (<code>true</code> for
861861 * directed, <code>false</code> for undirected).
862- * @deprecated use {@link Topology #addConnectivityListener(ConnectivityListener, Orientation)} instead.
862+ * @deprecated use {@link #addConnectivityListener(ConnectivityListener, Link. Orientation)} instead.
863863 */
864864 @ Deprecated
865865 public void addConnectivityListener (ConnectivityListener listener , boolean directed ) {
866- addConnectivityListener (listener , isDirected () );
866+ addConnectivityListener (listener , directed ? Orientation . DIRECTED : Orientation . UNDIRECTED );
867867 }
868868
869869 /**
@@ -882,25 +882,41 @@ public void addConnectivityListener(ConnectivityListener listener, Orientation o
882882 }
883883
884884 /**
885- * Unregisters the specified connectivity listener from the 'undirected'
886- * listeners.
885+ * <p>Unregisters the specified connectivity listener according to the orientation of the topology.</p>
886+ *
887+ * <p>The listener will be removed from the list of listeners, according to the current orientation of the topology.</p>
887888 *
888889 * @param listener The listener to unregister.
890+ * @see #getOrientation()
889891 */
890892 public void removeConnectivityListener (ConnectivityListener listener ) {
891- removeConnectivityListener (listener , false );
893+ removeConnectivityListener (listener , getOrientation () );
892894 }
893895
894896 /**
895- * Unregisters the specified connectivity listener from the listeners
896- * of the specified type.
897+ * <p> Unregisters the specified connectivity listener from the listeners
898+ * of the specified orientation.</p>
897899 *
898900 * @param listener The listener to unregister.
899- * @param directed The type of links that this listener was listening
901+ * @param directed The orientation of links that this listener was listening
900902 * (<code>true</code> for directed, <code>false</code> for undirected).
903+ * @deprecated use {@link #removeConnectivityListener(ConnectivityListener, Link.Orientation)} instead.
901904 */
905+ @ Deprecated
902906 public void removeConnectivityListener (ConnectivityListener listener , boolean directed ) {
903- if (directed )
907+ removeConnectivityListener (listener , directed ?Orientation .DIRECTED :Orientation .UNDIRECTED );
908+ }
909+
910+
911+ /**
912+ * <p>Unregisters the specified connectivity listener from the listeners
913+ * of the specified orientation.</p>
914+ *
915+ * @param listener The listener to unregister.
916+ * @param orientation The orientation of links that this listener was listening, as an {@link Orientation}.
917+ */
918+ public void removeConnectivityListener (ConnectivityListener listener , Orientation orientation ) {
919+ if (orientation == Orientation .DIRECTED )
904920 cxDirectedListeners .remove (listener );
905921 else
906922 cxUndirectedListeners .remove (listener );
0 commit comments