Added exceptions to javadoc comments.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141187 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brent Worden 2004-04-23 19:50:27 +00:00
parent 96840a4a34
commit 0505d2a32b
4 changed files with 44 additions and 10 deletions

View File

@ -23,26 +23,41 @@ import org.apache.commons.discovery.tools.DiscoverClass;
/**
* Abstract factory class for univariate statistical summaries.
*
* @version $Revision: 1.1 $ $Date: 2004/04/12 02:27:49 $
* @version $Revision: 1.2 $ $Date: 2004/04/23 19:50:27 $
*/
public abstract class DescriptiveStatistics implements Serializable, StatisticalSummary {
/**
* Create an instance of a <code>DescriptiveStatistics</code>
* @param cls the type of <code>DescriptiveStatistics</code> object to
* create.
* @return a new factory.
* @exception InstantiationException is thrown if the object can not be
* created.
* @exception IllegalAccessException is thrown if the type's default
* constructor is not accessible.
* @exception ClassNotFoundException if the named
* <code>DescriptiveStatistics</code> type can not be found.
*/
public static DescriptiveStatistics newInstance(String cls) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return newInstance(Class.forName(cls));
}
/**
* Create an instance of a <code>DescriptiveStatistics</code>
* @param cls the type of <code>DescriptiveStatistics</code> object to
* create.
* @return a new factory.
* @exception InstantiationException is thrown if the object can not be
* created.
* @exception IllegalAccessException is thrown if the type's default
* constructor is not accessible.
*/
public static DescriptiveStatistics newInstance(Class cls) throws InstantiationException, IllegalAccessException {
return (DescriptiveStatistics)cls.newInstance();
}
/**
/**
* Create an instance of a <code>DescriptiveStatistics</code>
* @return a new factory.
*/

View File

@ -22,7 +22,7 @@ import java.util.Arrays;
import org.apache.commons.math.util.ContractableDoubleArray;
/**
* @version $Revision: 1.1 $ $Date: 2004/04/12 02:27:49 $
* @version $Revision: 1.2 $ $Date: 2004/04/23 19:50:27 $
*/
public class DescriptiveStatisticsImpl extends AbstractDescriptiveStatistics implements Serializable {
@ -44,12 +44,17 @@ public class DescriptiveStatisticsImpl extends AbstractDescriptiveStatistics imp
/**
* Construct a DescriptiveStatisticsImpl with finite window
* @param window the finite window size.
*/
public DescriptiveStatisticsImpl(int window) {
super(window);
eDA = new ContractableDoubleArray();
}
/**
* Access the window size.
* @return the current window size.
*/
public int getWindowSize() {
return windowSize;
}

View File

@ -22,26 +22,41 @@ import org.apache.commons.discovery.tools.DiscoverClass;
/**
* Abstract factory class for univariate statistical summaries.
*
* @version $Revision: 1.1 $ $Date: 2004/04/12 02:27:49 $
* @version $Revision: 1.2 $ $Date: 2004/04/23 19:50:27 $
*/
public abstract class SummaryStatistics implements Serializable, StatisticalSummary{
/**
* Create an instance of a <code>SummaryStatistics</code>
* @return a new factory.
* @param cls the type of <code>SummaryStatistics</code> object to
* create.
* @return a new factory.
* @exception InstantiationException is thrown if the object can not be
* created.
* @exception IllegalAccessException is thrown if the type's default
* constructor is not accessible.
* @exception ClassNotFoundException if the named
* <code>SummaryStatistics</code> type can not be found.
*/
public static SummaryStatistics newInstance(String cls) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return newInstance(Class.forName(cls));
}
/**
* Create an instance of a <code>DescriptiveStatistics</code>
* @return a new factory.
* @param cls the type of <code>SummaryStatistics</code> object to
* create.
* @return a new factory.
* @exception InstantiationException is thrown if the object can not be
* created.
* @exception IllegalAccessException is thrown if the type's default
* constructor is not accessible.
*/
public static SummaryStatistics newInstance(Class cls) throws InstantiationException, IllegalAccessException {
return (SummaryStatistics)cls.newInstance();
}
/**
/**
* Create an instance of a <code>DescriptiveStatistics</code>
* @return a new factory.
*/

View File

@ -28,7 +28,7 @@ import org.apache.commons.math.MathException;
* It provides a means to set NumberTransformers that will be selected
* based on the Class of the object handed to the Maps
* <code>double transform(Object o)</code> method.
* @version $Revision: 1.11 $ $Date: 2004/02/21 21:35:16 $
* @version $Revision: 1.12 $ $Date: 2004/04/23 19:50:27 $
*/
public class TransformerMap implements NumberTransformer, Serializable {
@ -136,8 +136,7 @@ public class TransformerMap implements NumberTransformer, Serializable {
if (o instanceof Number || o instanceof String) {
value = defaultTransformer.transform(o);
} else {
NumberTransformer trans =
(NumberTransformer) this.getTransformer(o.getClass());
NumberTransformer trans = getTransformer(o.getClass());
if (trans != null) {
value = trans.transform(o);
}