source: other-projects/the-macronizer/trunk/src/java/monogram/model/MonogramFactory.java@ 29855

Last change on this file since 29855 was 29855, checked in by davidb, 9 years ago

John's code after refactoring by Tom over the summer of 2014/2015

File size: 1.4 KB
Line 
1
2package monogram.model;
3
4import util.Pool;
5
6/**
7 * The monogram factory opens a new pool worker thread that is used to build two monogram models.
8 * One for the macron data and one for the double vowel data.
9 * When the pool thread is done this it clears the pool.
10 *
11 * @see MonogramMode
12 *
13 *
14 * @author University of Waikato - Te Whare Wānanga o Waikato
15 * @version 1.0
16 * @since 2014-11-20
17 */
18
19public class MonogramFactory {
20
21 private final static MonogramModel macronModel;
22 private final static MonogramModel doubleVowelModel;
23 private final static ListModel blackList;
24
25 static {
26 final Pool<String> pool = new Pool<String>();
27 macronModel = new MonogramModel("../data/macron", pool);
28 doubleVowelModel = new MonogramModel("../data/doublevowel", pool);
29 blackList = new ListModel("../data/list/blacklist.data", pool);
30 pool.clear();
31 }
32
33 private MonogramFactory() {
34 //hide constructor.
35 }
36/** monogram model for macron data (/data/macron) */
37 public static MonogramModel getMacronModel() {
38
39 return macronModel;
40 }
41/** monogram model for double vowel data (/data/doubleVowel) */
42 public static MonogramModel getDoubleVowelModel() {
43 return doubleVowelModel;
44 }
45
46 /** monogram model for black list data (/data/blacklist) */
47 public static ListModel getBlackList() {
48 return blackList;
49 }
50}
Note: See TracBrowser for help on using the repository browser.