public boolean removeBusStop ( String name ) { Iterator < BusStop > iterator ; BusStop busStop ; iterator = this . validBusStops . iterator ( ) ; while ( iterator . hasNext ( ) ) { busStop = iterator . next ( ) ; if ( name . equals ( busStop . getName ( ) ) ) { iterator . remove ( ) ; busStop . setContainer ( null ) ; busStop . setEventFirable ( true ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , //$NON-NLS-1$ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } iterator = this . invalidBusStops . iterator ( ) ; while ( iterator . hasNext ( ) ) { busStop = iterator . next ( ) ; if ( name . equals ( busStop . getName ( ) ) ) { iterator . remove ( ) ; busStop . setContainer ( null ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . STOP_REMOVED , busStop , - 1 , "shape" , //$NON-NLS-1$ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } } return false ; }
Remove the bus stops with the given name . If this bus stop removal implies empty hubs these hubs will be also removed .