private void disposeTriggersAndDataProviders ( ) { for ( final Map . Entry < T , List < DP > > entry : triggersToDataProviders . entrySet ( ) ) { // Disconnect from trigger unhookFromTrigger ( entry . getKey ( ) ) ; // Dispose trigger itself final T trigger = entry . getKey ( ) ; if ( trigger instanceof Disposable ) { ( ( Disposable ) trigger ) . dispose ( ) ; } // Dispose data providers final List < DP > dataProviders = entry . getValue ( ) ; if ( dataProviders != null ) { for ( final DP dataProvider : dataProviders ) { if ( dataProvider instanceof Disposable ) { ( ( Disposable ) dataProvider ) . dispose ( ) ; } } } } // Clears all triggers triggersToDataProviders . clear ( ) ; }
Disposes all triggers and data providers that are mapped to each other .