public boolean removeBusHalt ( int index ) { try { final BusItineraryHalt removedBushalt ; if ( index < this . validHalts . size ( ) ) { removedBushalt = this . validHalts . remove ( index ) ; } else { final int idx = index - this . validHalts . size ( ) ; removedBushalt = this . invalidHalts . remove ( idx ) ; } removedBushalt . setContainer ( null ) ; removedBushalt . setRoadSegmentIndex ( - 1 ) ; removedBushalt . setPositionOnSegment ( Float . NaN ) ; removedBushalt . setEventFirable ( true ) ; removedBushalt . checkPrimitiveValidity ( ) ; fireShapeChanged ( new BusChangeEvent ( this , BusChangeEventType . ITINERARY_HALT_REMOVED , removedBushalt , removedBushalt . indexInParent ( ) , "shape" , //$NON-NLS-1$ null , null ) ) ; checkPrimitiveValidity ( ) ; return true ; } catch ( Throwable exception ) { // } return false ; }
Remove the bus halt at the specified index .