3
* $Date: 2007-01-04 18:46:10 +0100 (Thu, 04 Jan 2007) $
6
* Copyright (C) 2003-2007 The CDK Development Team
8
* Contact: cdk-devel@lists.sourceforge.net
10
* This library is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU Lesser General Public
12
* License as published by the Free Software Foundation; either
13
* version 2.1 of the License, or (at your option) any later version.
15
* This library 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
* Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public
21
* License along with this library; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24
package org.openscience.cdk.io.setting;
26
import org.openscience.cdk.exception.CDKException;
29
* An interface for reader settings. It is subclassed by implementations,
30
* one for each type of field, e.g. IntReaderSetting.
34
* @author Egon Willighagen <egonw@sci.kun.nl>
36
public abstract class IOSetting {
38
/** The levels available:
39
* HIGH important question
41
* LOW unimportant question
43
public static final int HIGH = 0;
44
public static final int MEDIUM = 1;
45
public static final int LOW = 2;
48
protected String name;
49
protected String question;
50
protected String setting;
53
* The default constructor that sets this field. All textual
54
* information is supposed to be English. Localization is taken care
55
* off by the ReaderConfigurator.
57
* @param name Name of the setting
58
* @param level Level at which question is asked
59
* @param question Question that is poped to the user when the
60
* ReaderSetting needs setting
61
* @param defaultSetting The default setting, used if not overwritten
64
public IOSetting(String name, int level,
65
String question, String defaultSetting) {
68
this.question = question;
69
this.setting = defaultSetting;
72
public String getName() {
76
public String getQuestion() {
80
public String getDefaultSetting() {
84
public int getLevel() {
89
* Sets the setting for a certain question. It will throw
90
* a CDKException when the setting is not valid.
93
public void setSetting(String setting) throws CDKException {
94
// by default, except all input, so no setting checking
95
this.setting = setting;
99
* Sets the setting for a certain question. It will throw
100
* a CDKException when the setting is not valid.
103
public String getSetting() {
104
// by default, except all input, so no setting checking