com.townleyenterprises.command
Class MutexOptionConstraint

java.lang.Object
  extended bycom.townleyenterprises.command.OptionConstraint
      extended bycom.townleyenterprises.command.MutexOptionConstraint

public class MutexOptionConstraint
extends OptionConstraint

This class provides an implementation of a mutual exclusion constraint for two options.

Since:
3.0
Version:
$Id: MutexOptionConstraint.java,v 1.1 2004/07/30 16:20:22 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
MutexOptionConstraint(int status, CommandOption opt, CommandOption opt2)
          The constructor initializes the option being constrained and an exit status.
MutexOptionConstraint(int status, CommandOption opt, CommandOption opt2, java.lang.String message)
          The constructor initializes the option being constrained, an exit status and message to be used during failure.
 
Method Summary
 java.lang.String getMessage()
           
 boolean isOK()
          This method should be implemented by derived classes to perform the constraint check.
 
Methods inherited from class com.townleyenterprises.command.OptionConstraint
getExitStatus, getOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutexOptionConstraint

public MutexOptionConstraint(int status,
                             CommandOption opt,
                             CommandOption opt2)
The constructor initializes the option being constrained and an exit status.

Parameters:
status - the status code
opt - the option being constrained
opt2 - the other option

MutexOptionConstraint

public MutexOptionConstraint(int status,
                             CommandOption opt,
                             CommandOption opt2,
                             java.lang.String message)
The constructor initializes the option being constrained, an exit status and message to be used during failure.

Parameters:
status - the status code
opt - the option being constrained
opt2 - the other option
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class OptionConstraint

isOK

public boolean isOK()
Description copied from class: OptionConstraint
This method should be implemented by derived classes to perform the constraint check.

Specified by:
isOK in class OptionConstraint
Returns:
true if the constraint is valid; false otherwise


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.