Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/pqt/cloptions/FlagOption.java


1   //AutoRIB
2   // Copyright © 1998 - 2002, P W Quint
3   //
4   // Contact: autorib00@aol.com
5   //
6   // This library is free software; you can redistribute it and/or
7   // modify it under the terms of the GNU General Public
8   // License as published by the Free Software Foundation; either
9   // version 2 of the License, or (at your option) any later version.
10  //
11  // This library is distributed in the hope that it will be useful,
12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  // General Public License for more details.
15  //
16  // You should have received a copy of the GNU General Public
17  // License along with this library; if not, write to the Free Software
18  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  
20  package org.pqt.cloptions;
21  
22  
23  
24  /**
25  
26   * this class implements a command line option that is set simply by appearing on
27  
28   * the command line - so the option is not followed by a +/- to indicate the state
29  
30   * of the option
31  
32   */
33  
34  
35  
36  public class FlagOption extends Option {
37  
38      
39  
40      
41  
42      public boolean value = false;
43  
44      
45  
46      public FlagOption(String shortNames, String longNames) {
47  
48          super(shortNames, longNames);
49  
50      }
51  
52      
53  
54      /** do nothing, simply set the value of the option to true */
55  
56      public void doRead(OptionProcessor op) {
57  
58          value = true;
59  
60      }
61  
62      
63  
64  }