public final Map < String , DataCollector > getDataCollectors ( ) { final Map < String , DataCollector > collectorsRet = new HashMap <> ( ) ; for ( final Class < DataCollector > c : collectors ) { DataCollector dc ; try { dc = c . newInstance ( ) ; collectorsRet . put ( dc . getName ( ) , dc ) ; } catch ( final InstantiationException e ) { e . printStackTrace ( ) ; } catch ( final IllegalAccessException e ) { e . printStackTrace ( ) ; } } return collectorsRet ; }
Returns new DataCollectors which are saved in the current DataCollectorList . Every time this method is called there are new DataCollectors instanciated .