public boolean removeBusLine ( String name ) { final Iterator < BusLine > iterator = this . busLines . iterator ( ) ; BusLine busLine ; int i = 0 ; while ( iterator . hasNext ( ) ) { busLine = iterator . next ( ) ; if ( name . equals ( busLine . getName ( ) ) ) { iterator . remove ( ) ; busLine . setContainer ( null ) ; busLine . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . LINE_REMOVED , busLine , i , "shape" , //$NON-NLS-1$ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } ++ i ; } return false ; }
Remove the bus line with the given name . All the itineraries and the associated stops will be removed also . If this bus line removal implies empty hubs these hubs will be also removed .