/** * A copy constructor. Creates a deep-copy of the {@code original}. * * @param original the {@code SummaryStatistics} instance to copy * @throws NullArgumentException if original is null */ public SummaryStatistics(SummaryStatistics original) throws NullArgumentException { copy(original, this); }
/** * Returns a copy of this SummaryStatistics instance with the same internal state. * * @return a copy of this */ public SummaryStatistics copy() { SummaryStatistics result = new SummaryStatistics(); // No try-catch or advertised exception because arguments are guaranteed non-null 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); // No try - catch or advertising NAE because neither argument will ever be null SummaryStatistics.copy(statisticsPrototype, contributingStatistics); return contributingStatistics; }
/** * 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 NullArgumentException if either source or dest is null */ public static void copy(SynchronizedSummaryStatistics source, SynchronizedSummaryStatistics dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); synchronized (source) { synchronized (dest) { SummaryStatistics.copy(source, dest); } } }
/** * A copy constructor. Creates a deep-copy of the {@code original}. * * @param original the {@code SummaryStatistics} instance to copy * @throws NullArgumentException if original is null */ public SummaryStatistics(SummaryStatistics original) throws NullArgumentException { copy(original, this); }
/** * A copy constructor. Creates a deep-copy of the {@code original}. * * @param original the {@code SummaryStatistics} instance to copy * @throws NullArgumentException if original is null */ public SummaryStatistics(SummaryStatistics original) throws NullArgumentException { copy(original, this); }
/** * Returns a copy of this SummaryStatistics instance with the same internal state. * * @return a copy of this */ public SummaryStatistics copy() { SummaryStatistics result = new SummaryStatistics(); // No try-catch or advertised exception because arguments are guaranteed non-null 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(); // No try-catch or advertised exception because arguments are guaranteed non-null 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); // No try - catch or advertising NAE because neither argument will ever be null 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); // No try - catch or advertising NAE because neither argument will ever be null SummaryStatistics.copy(statisticsPrototype, contributingStatistics); return contributingStatistics; }
/** * 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 NullArgumentException if either source or dest is null */ public static void copy(SynchronizedSummaryStatistics source, SynchronizedSummaryStatistics dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(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 NullArgumentException if either source or dest is null */ public static void copy(SynchronizedSummaryStatistics source, SynchronizedSummaryStatistics dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); synchronized (source) { synchronized (dest) { SummaryStatistics.copy(source, dest); } } }