com.townleyenterprises.command
Class RequiresAnyOptionConstraint

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

public class RequiresAnyOptionConstraint
extends OptionConstraint

This class provides an implementation of a dependency constraint between options.

Since:
3.0
Version:
$Id: RequiresAnyOptionConstraint.java,v 1.2 2004/11/21 20:40:59 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
RequiresAnyOptionConstraint(int status, CommandOption opt, CommandOption[] deps)
          The constructor initializes the option being constrained and an exit status.
RequiresAnyOptionConstraint(int status, CommandOption opt, CommandOption[] deps, 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

RequiresAnyOptionConstraint

public RequiresAnyOptionConstraint(int status,
                                   CommandOption opt,
                                   CommandOption[] deps)
The constructor initializes the option being constrained and an exit status.

Parameters:
status - the status code
opt - the option being constrained
deps - the dependent options

RequiresAnyOptionConstraint

public RequiresAnyOptionConstraint(int status,
                                   CommandOption opt,
                                   CommandOption[] deps,
                                   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
deps - the dependent options
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.