public List < Link > getConnectedLinks ( PhysicalElement pe ) { List < Link > myLinks = new ArrayList <> ( ) ; for ( Link l : this . links ) { if ( l . getElement ( ) . equals ( pe ) ) { myLinks . add ( l ) ; } else if ( l . getSwitch ( ) . equals ( pe ) ) { myLinks . add ( l ) ; } } return myLinks ; }
Get the list of links connected to a given physical element