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

Quick Search    Search Deep

gnu.dtools.ritopt
Class OptionEvent  view OptionEvent download OptionEvent.java

java.lang.Object
  extended bygnu.dtools.ritopt.OptionEvent

public class OptionEvent
extends java.lang.Object

An event indicating that an option has been invoked. When an OptionListener is notified by a NotifyOption, it passes an OptionEvent object to all registered listeners. This includes the target NotifyOption, a command (NotifyOption passes the long option by default), and the option value.


 Copyright (C) Damian Ryan Eads, 2001. All Rights Reserved.

 ritopt is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 ritopt is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with ritopt; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 


Field Summary
private  java.lang.String command
          The command string associated with this option processing event.
private  Option target
          The target Option in which the option processing event occurred.
private  java.lang.String value
          The value of the option processing event.
 
Constructor Summary
OptionEvent()
          Constructs an option event with the command set to "Default", the value set to the empty string, and the target set to null.
OptionEvent(Option option)
          Constructs an option event with the command set to the long or short option (whichever exists), the value set to the current value of the option, and the target option set to the option passed.
OptionEvent(java.lang.String command)
          Constructs an option event with the command set to the value passed, the value set to the empty string, and the target set to null.
OptionEvent(java.lang.String command, java.lang.String value)
          Constructs an option event with the command and value set to the values passed, and the target set to null.
OptionEvent(java.lang.String command, java.lang.String value, Option target)
          Constructs an option event with the command, value, and target set to the values passed.
 
Method Summary
 java.lang.String getCommand()
          Returns the command string associated with the option.
 Option getTarget()
          Returns the target option of the option processing event.
 java.lang.String getValue()
          Returns the value associated with the target option.
 void setCommand(java.lang.String command)
          Sets the command string to the value passed.
 void setTarget(Option target)
          Sets the target option of the option processing event.
 void setValue(java.lang.String value)
          Sets the value of this option event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

private java.lang.String command
The command string associated with this option processing event.


value

private java.lang.String value
The value of the option processing event.


target

private Option target
The target Option in which the option processing event occurred.

Constructor Detail

OptionEvent

public OptionEvent()
Constructs an option event with the command set to "Default", the value set to the empty string, and the target set to null.


OptionEvent

public OptionEvent(java.lang.String command)
Constructs an option event with the command set to the value passed, the value set to the empty string, and the target set to null.


OptionEvent

public OptionEvent(java.lang.String command,
                   java.lang.String value)
Constructs an option event with the command and value set to the values passed, and the target set to null.


OptionEvent

public OptionEvent(Option option)
Constructs an option event with the command set to the long or short option (whichever exists), the value set to the current value of the option, and the target option set to the option passed. If neither the short or long option exist, a value of "Default" is assigned.


OptionEvent

public OptionEvent(java.lang.String command,
                   java.lang.String value,
                   Option target)
Constructs an option event with the command, value, and target set to the values passed.

Method Detail

getCommand

public java.lang.String getCommand()
Returns the command string associated with the option.


getValue

public java.lang.String getValue()
Returns the value associated with the target option.


getTarget

public Option getTarget()
Returns the target option of the option processing event.


setCommand

public void setCommand(java.lang.String command)
Sets the command string to the value passed.


setValue

public void setValue(java.lang.String value)
Sets the value of this option event. This value generally should be equal to the value of the target option.


setTarget

public void setTarget(Option target)
Sets the target option of the option processing event.