~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/choices/IntegerChoice.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 org.crosswire.common.util.Convert;
5
 
 
6
 
/**
7
 
* IntegerChoice.
8
 
*
9
 
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
10
 
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
11
 
* Distribution Licence:<br />
12
 
* Project B is free software; you can redistribute it
13
 
* and/or modify it under the terms of the GNU General Public License,
14
 
* version 2 as published by the Free Software Foundation.<br />
15
 
* This program is distributed in the hope that it will be useful,
16
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
 
* General Public License for more details.<br />
19
 
* The License is available on the internet
20
 
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
21
 
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22
 
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
23
 
* The copyright to this program is held by it's authors.
24
 
* </font></td></tr></table>
25
 
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
26
 
* @see <{docs.Licence}>
27
 
* @author Joe Walker
28
 
*/
29
 
public abstract class IntegerChoice extends AbstractChoice
30
 
{
31
 
    /**
32
 
    * Generalized read integer from the Properties file
33
 
    * @return Found int or the default value
34
 
    */
35
 
    public abstract int getInt();
36
 
 
37
 
    /**
38
 
    * Generalized set integer to the Properties file
39
 
    * @param value The value to enter
40
 
    */
41
 
    public abstract void setInt(int value) throws Exception;
42
 
 
43
 
    /**
44
 
    * Generalized read boolean from the Properties file
45
 
    * @return Found boolean or the default value
46
 
    */
47
 
    public String getString()
48
 
    {
49
 
        return Convert.int2String(getInt());
50
 
    }
51
 
 
52
 
    /**
53
 
    * Generalized set boolean to the Properties file
54
 
    * @param value The value to enter
55
 
    */
56
 
    public void setString(String value) throws Exception
57
 
    {
58
 
        setInt(Convert.string2Int(value));
59
 
    }
60
 
 
61
 
    /**
62
 
    * Override this to check and note any change
63
 
    */
64
 
    public String getType()
65
 
    {
66
 
        return "number";
67
 
    }
68
 
}