From cc683148826f0e2ae9af99a1e9483ea999b2d2a2 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Sun, 11 Jan 2004 07:19:52 +0000 Subject: [PATCH] Added load(URL). Addressing PR #25972, reported by Bill Barker. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141049 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/random/EmpiricalDistribution.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/math/random/EmpiricalDistribution.java b/src/java/org/apache/commons/math/random/EmpiricalDistribution.java index 6d569babc..9d8382598 100644 --- a/src/java/org/apache/commons/math/random/EmpiricalDistribution.java +++ b/src/java/org/apache/commons/math/random/EmpiricalDistribution.java @@ -56,6 +56,7 @@ package org.apache.commons.math.random; import java.io.IOException; import java.io.File; +import java.net.URL; import java.util.ArrayList; import org.apache.commons.math.stat.DescriptiveStatistics; @@ -80,24 +81,31 @@ import org.apache.commons.math.stat.DescriptiveStatistics; * build grouped frequnecy histograms representing the input data or to * generate random values "like" those in the input file -- i.e., the values * generated will follow the distribution of the values in the file. - * @version $Revision: 1.10 $ $Date: 2003/11/15 16:01:37 $ + * @version $Revision: 1.11 $ $Date: 2004/01/11 07:19:52 $ */ public interface EmpiricalDistribution { /** - * Computes the empirical distribution from the input file + * Computes the empirical distribution from the input file. * @param filePath fully qualified name of a file in the local file system * @throws IOException if an IO error occurs */ void load(String filePath) throws IOException; /** - * Computes the empirical distribution from the input file - * @param file url of the input file + * Computes the empirical distribution from the input file. + * @param file the input file * @throws IOException if an IO error occurs */ void load(File file) throws IOException; + /** + * Computes the empirical distribution using data read from a URL. + * @param file url of the input file + * @throws IOException if an IO error occurs + */ + void load(URL url) throws IOException; + /** * Generates a random value from this distribution. * Preconditions: