01: /*
02: * Copyright 2005 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.math.stat.inference;
17:
18: import org.apache.commons.discovery.tools.DiscoverClass;
19:
20: /**
21: * Abstract factory to create inference test instances.
22: *
23: * @since 1.1
24: * @version $Revision: 209144 $ $Date: 2005-07-04 16:30:05 -0700 (Mon, 04 Jul 2005) $
25: */
26: public abstract class TestFactory {
27: /**
28: * Default constructor.
29: */
30: protected TestFactory() {
31: super ();
32: }
33:
34: /**
35: * Create an instance of a <code>TestFactory</code>
36: *
37: * @return a new factory.
38: */
39: public static TestFactory newInstance() {
40: TestFactory factory = null;
41: try {
42: DiscoverClass dc = new DiscoverClass();
43: factory = (TestFactory) dc
44: .newInstance(TestFactory.class,
45: "org.apache.commons.math.stat.inference.TestFactoryImpl");
46: } catch (Throwable t) {
47: return new TestFactoryImpl();
48: }
49: return factory;
50: }
51:
52: /**
53: * Create a TTest instance.
54: *
55: * @return a new TTest instance
56: */
57: public abstract TTest createTTest();
58:
59: /**
60: * Create a ChiSquareTest instance.
61: *
62: * @return a new ChiSquareTest instance
63: */
64: public abstract ChiSquareTest createChiSquareTest();
65: }
|