~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/choices/HashtableChoice.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:
1
 
 
2
 
package org.crosswire.common.config.choices;
3
 
 
4
 
import java.util.Hashtable;
5
 
 
6
 
import org.crosswire.common.util.Convert;
7
 
 
8
 
/**
9
 
* IntegerChoice.
10
 
*
11
 
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
12
 
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
13
 
* Distribution Licence:<br />
14
 
* Project B is free software; you can redistribute it
15
 
* and/or modify it under the terms of the GNU General Public License,
16
 
* version 2 as published by the Free Software Foundation.<br />
17
 
* This program is distributed in the hope that it will be useful,
18
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
 
* General Public License for more details.<br />
21
 
* The License is available on the internet
22
 
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
23
 
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24
 
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
25
 
* The copyright to this program is held by it's authors.
26
 
* </font></td></tr></table>
27
 
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
28
 
* @see <{docs.Licence}>
29
 
* @author Joe Walker
30
 
*/
31
 
public abstract class HashtableChoice extends AbstractChoice
32
 
{
33
 
    /**
34
 
    * Construct an Object Choice
35
 
    */
36
 
    public HashtableChoice(Class superclass)
37
 
    {
38
 
        this.superclass = superclass;
39
 
    }
40
 
 
41
 
    /**
42
 
    * Construct an Object Choice
43
 
    */
44
 
    public HashtableChoice()
45
 
    {
46
 
        this.superclass = Object.class;
47
 
    }
48
 
 
49
 
    /**
50
 
    * Generalized read Object from the Properties file
51
 
    * @return Found int or the default value
52
 
    */
53
 
    public abstract Hashtable getHashtable();
54
 
 
55
 
    /**
56
 
    * Generalized set Object to the Properties file
57
 
    * @param value The value to enter
58
 
    */
59
 
    public abstract void setHashtable(Hashtable value);
60
 
 
61
 
    /**
62
 
    * Generalized read boolean from the Properties file
63
 
    * @return Found boolean or the default value
64
 
    */
65
 
    public String getString()
66
 
    {
67
 
        return Convert.hashtable2String(getHashtable());
68
 
    }
69
 
 
70
 
    /**
71
 
    * Generalized set boolean to the Properties file
72
 
    * @param value The value to enter
73
 
    */
74
 
    public void setString(String value)
75
 
    {
76
 
        setHashtable(Convert.string2Hashtable(value));
77
 
    }
78
 
 
79
 
    /**
80
 
    * Override this to check and note any change
81
 
    */
82
 
    public String getType()
83
 
    {
84
 
        return "hash";
85
 
        // new HashtableField(this, superclass);
86
 
    }
87
 
 
88
 
    /**
89
 
    * The type that we are editing
90
 
    */
91
 
    public Object getTypeOptions()
92
 
    {
93
 
        return superclass;
94
 
    }
95
 
 
96
 
    /** The superclass of any hashtable values */
97
 
    private Class superclass = null;
98
 
}