~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/jsword/org/crosswire/jsword/book/raw/ItemsMem.java

  • Committer: joe
  • Date: 2002-10-08 21:36:18 UTC
  • Revision ID: svn-v4:a88caf3b-7e0a-0410-8d0d-cecb45342206:trunk:80
big config and comment update

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import java.io.ObjectInputStream;
7
7
import java.io.ObjectOutputStream;
8
8
import java.io.OutputStream;
9
 
import java.util.Enumeration;
 
9
import java.util.HashMap;
10
10
import java.util.Hashtable;
 
11
import java.util.Iterator;
 
12
import java.util.Map;
11
13
 
12
14
/**
13
 
* ItemsMem is a Base implementation of the Items interface using the in
14
 
* memory model (Mem).
15
 
*
16
 
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
17
 
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
18
 
* Distribution Licence:<br />
19
 
* Project B is free software; you can redistribute it
20
 
* and/or modify it under the terms of the GNU General Public License,
21
 
* version 2 as published by the Free Software Foundation.<br />
22
 
* This program is distributed in the hope that it will be useful,
23
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
 
* General Public License for more details.<br />
26
 
* The License is available on the internet
27
 
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
28
 
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29
 
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
30
 
* The copyright to this program is held by it's authors.
31
 
* </font></td></tr></table>
32
 
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
33
 
* @see <{docs.Licence}>
34
 
* @author Joe Walker
35
 
* @version D0.I0.T0
36
 
*/
 
15
 * ItemsMem is a Base implementation of the Items interface using the in
 
16
 * memory model (Mem).
 
17
 * 
 
18
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 
19
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
 
20
 *
 
21
 * Distribution Licence:<br />
 
22
 * JSword is free software; you can redistribute it
 
23
 * and/or modify it under the terms of the GNU General Public License,
 
24
 * version 2 as published by the Free Software Foundation.<br />
 
25
 * This program is distributed in the hope that it will be useful,
 
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
28
 * General Public License for more details.<br />
 
29
 * The License is available on the internet
 
30
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 
31
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 
32
 * MA 02111-1307, USA<br />
 
33
 * The copyright to this program is held by it's authors.
 
34
 * </font></td></tr></table>
 
35
 * @see docs.Licence
 
36
 * @author Joe Walker [joe at eireneh dot com]
 
37
 * @version $Id$
 
38
 */
37
39
public abstract class ItemsMem extends Mem implements Items
38
40
{
39
41
    /**
70
72
    */
71
73
    public void init()
72
74
    {
73
 
        hash = new Hashtable(getMaxItems());
 
75
        hash = new HashMap(getMaxItems());
74
76
        array = new String[getMaxItems()];
75
77
    }
76
78
 
109
111
    * Get an Enumeration through the words
110
112
    * @return An Enumeration
111
113
    */
112
 
    public Enumeration getEnumeration()
 
114
    public Iterator iterator()
113
115
    {
114
 
        return hash.keys();
 
116
        return hash.keySet().iterator();
115
117
    }
116
118
 
117
119
    /**
187
189
    }
188
190
 
189
191
    /** Map of word to their indexes */
190
 
    protected Hashtable hash;
 
192
    protected Map hash;
191
193
 
192
194
    /** Converting indexes to Words - this is about the number of words in the Bible */
193
195
    protected String[] array;