/** * A copy constructor. Creates a deep-copy of the {@code original}. * * @param original the {@code SummaryStatistics} instance to copy */ public SummaryStatistics(SummaryStatistics original) { copy(original, this); }
/** * A copy constructor. Creates a deep-copy of the {@code original}. * * @param original the {@code SummaryStatistics} instance to copy */ public SummaryStatistics(SummaryStatistics original) { copy(original, this); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * <p>Acquires synchronization lock on source, then dest before copying.</p> * * @param source SynchronizedSummaryStatistics to copy * @param dest SynchronizedSummaryStatistics to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(SynchronizedSummaryStatistics source, SynchronizedSummaryStatistics dest) { synchronized (source) { synchronized (dest) { SummaryStatistics.copy(source, dest); } } }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * <p>Acquires synchronization lock on source, then dest before copying.</p> * * @param source SynchronizedSummaryStatistics to copy * @param dest SynchronizedSummaryStatistics to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(SynchronizedSummaryStatistics source, SynchronizedSummaryStatistics dest) { synchronized (source) { synchronized (dest) { SummaryStatistics.copy(source, dest); } } }
/** * Get a copy of all the accumulated data * @return a copy of all the accumulated data */ public static synchronized Map<String, SummaryStatistics> getTimes() { HashMap<String, SummaryStatistics> ret = new HashMap<String, SummaryStatistics>(); for (Entry<String, SummaryStatistics> e : times.entrySet()) { ret.put(e.getKey(), e.getValue().copy()); } return ret; }
/** * Get a copy of all the accumulated data * @return a copy of all the accumulated data */ public static synchronized Map<String, SummaryStatistics> getTimes() { HashMap<String, SummaryStatistics> ret = new HashMap<String, SummaryStatistics>(); for (Entry<String, SummaryStatistics> e : times.entrySet()) { ret.put(e.getKey(), e.getValue().copy()); } return ret; }
/** * Returns a copy of this SummaryStatistics instance with the same internal state. * * @return a copy of this */ public SummaryStatistics copy() { SummaryStatistics result = new SummaryStatistics(); copy(this, result); return result; }
/** * Returns a copy of this SummaryStatistics instance with the same internal state. * * @return a copy of this */ public SummaryStatistics copy() { SummaryStatistics result = new SummaryStatistics(); copy(this, result); return result; }
/** * Creates and returns a {@code SummaryStatistics} whose data will be * aggregated with those of this {@code AggregateSummaryStatistics}. * * @return a {@code SummaryStatistics} whose data will be aggregated with * those of this {@code AggregateSummaryStatistics}. The initial state * is a copy of the configured prototype statistics. */ public SummaryStatistics createContributingStatistics() { SummaryStatistics contributingStatistics = new AggregatingSummaryStatistics(statistics); SummaryStatistics.copy(statisticsPrototype, contributingStatistics); return contributingStatistics; }
/** * Creates and returns a {@code SummaryStatistics} whose data will be * aggregated with those of this {@code AggregateSummaryStatistics}. * * @return a {@code SummaryStatistics} whose data will be aggregated with * those of this {@code AggregateSummaryStatistics}. The initial state * is a copy of the configured prototype statistics. */ public SummaryStatistics createContributingStatistics() { SummaryStatistics contributingStatistics = new AggregatingSummaryStatistics(statistics); SummaryStatistics.copy(statisticsPrototype, contributingStatistics); return contributingStatistics; }