01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2005, 2007 Robert Grimm
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public License
07: * version 2.1 as published by the Free Software Foundation.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17: * USA.
18: */
19: package xtc.util;
20:
21: /**
22: * A command line option.
23: *
24: * @author Robert Grimm
25: * @version $Revision: 1.6 $
26: */
27: class Option {
28:
29: /** The kind. */
30: public static enum Kind {
31: BOOLEAN, WORD, INTEGER, FILE, DIRECTORY, ATTRIBUTE
32: }
33:
34: /** The kind. */
35: public final Kind kind;
36:
37: /** The external name. */
38: public final String external;
39:
40: /** The internal name. */
41: public final String internal;
42:
43: /** The default value, which must be consistent with the kind. */
44: public final Object value;
45:
46: /** The flag for multiple occurrences. */
47: public final boolean multiple;
48:
49: /** The description. */
50: public final String description;
51:
52: /**
53: * Create a new option.
54: *
55: * @param kind The kind.
56: * @param external The external name.
57: * @param internal The internal name.
58: * @param value The default value, which may be <code>null</code>.
59: * @param multiple The flag for multiple occurrences.
60: * @param description The description.
61: */
62: public Option(Kind kind, String external, String internal,
63: Object value, boolean multiple, String description) {
64: this.kind = kind;
65: this.external = external;
66: this.internal = internal;
67: this.value = value;
68: this.multiple = multiple;
69: this.description = description;
70: }
71:
72: }
|