/** * Copy constructor. Construct a new DescriptiveStatistics instance that * is a copy of original. * * @param original DescriptiveStatistics instance to copy * @throws NullArgumentException if original is null */ public DescriptiveStatistics(DescriptiveStatistics original) throws NullArgumentException { copy(original, this); }
/** * Returns a copy of this DescriptiveStatistics instance with the same internal state. * * @return a copy of this */ public DescriptiveStatistics copy() { DescriptiveStatistics result = new DescriptiveStatistics(); // No try-catch or advertised exception because parms are guaranteed valid copy(this, result); return result; }
/** * 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 SynchronizedDescriptiveStatistics to copy * @param dest SynchronizedDescriptiveStatistics to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(SynchronizedDescriptiveStatistics source, SynchronizedDescriptiveStatistics dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); synchronized (source) { synchronized (dest) { DescriptiveStatistics.copy(source, dest); } } } }
/** * Copy constructor. Construct a new DescriptiveStatistics instance that * is a copy of original. * * @param original DescriptiveStatistics instance to copy * @throws NullArgumentException if original is null */ public DescriptiveStatistics(DescriptiveStatistics original) throws NullArgumentException { copy(original, this); }
/** * Returns a copy of this DescriptiveStatistics instance with the same internal state. * * @return a copy of this */ public DescriptiveStatistics copy() { DescriptiveStatistics result = new DescriptiveStatistics(); // No try-catch or advertised exception because parms are guaranteed valid copy(this, result); return result; }
/** * 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 SynchronizedDescriptiveStatistics to copy * @param dest SynchronizedDescriptiveStatistics to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(SynchronizedDescriptiveStatistics source, SynchronizedDescriptiveStatistics dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); synchronized (source) { synchronized (dest) { DescriptiveStatistics.copy(source, dest); } } } }