1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.math.stat.inference;
17 import org.apache.commons.discovery.tools.DiscoverClass;
18
19 /**
20 * Abstract factory to create inference test instances.
21 *
22 * @since 1.1
23 * @version $Revision: 209144 $ $Date: 2005-07-04 16:30:05 -0700 (Mon, 04 Jul 2005) $
24 */
25 public abstract class TestFactory {
26 /**
27 * Default constructor.
28 */
29 protected TestFactory() {
30 super();
31 }
32
33 /**
34 * Create an instance of a <code>TestFactory</code>
35 *
36 * @return a new factory.
37 */
38 public static TestFactory newInstance() {
39 TestFactory factory = null;
40 try {
41 DiscoverClass dc = new DiscoverClass();
42 factory = (TestFactory) dc.newInstance(
43 TestFactory.class,
44 "org.apache.commons.math.stat.inference.TestFactoryImpl");
45 } catch(Throwable t) {
46 return new TestFactoryImpl();
47 }
48 return factory;
49 }
50
51 /**
52 * Create a TTest instance.
53 *
54 * @return a new TTest instance
55 */
56 public abstract TTest createTTest();
57
58 /**
59 * Create a ChiSquareTest instance.
60 *
61 * @return a new ChiSquareTest instance
62 */
63 public abstract ChiSquareTest createChiSquareTest();
64 }