/** * Make a shallow copy of this metric only including the portions designated in the Filter * * <p>Note: since this is a shallow copy it is dangerous to modify the submetrics * * @param transportServiceMonitorFilter Filter designates constituant parts to be included * @return a copy of this metric with references to the designated parts */ public TransportServiceMetric shallowCopy( TransportServiceMonitorFilter transportServiceMonitorFilter) { TransportServiceMetric serviceMetric = new TransportServiceMetric(); serviceMetric.moduleClassID = moduleClassID; for (Iterator i = getTransportMetrics(); i.hasNext(); ) { TransportMetric transportMetric = (TransportMetric) i.next(); String protocol = transportMetric.getProtocol(); if (transportServiceMonitorFilter.hasTransport(protocol)) serviceMetric.addTransportMetric(transportMetric); } return serviceMetric; }