ml.options
public class ExclusiveConstraint extends java.lang.Object implements XMLConstraint
Constraints of this kind are also accounted for in the DefaultHelpPrinter
to format the output provided.
Constructor and Description |
---|
ExclusiveConstraint()
The public no-org constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
add(OptionSet optionSet,
Options.Multiplicity multiplicity,
java.lang.String... keys)
Add a constraint to the given option set
|
static void |
add(OptionSet optionSet,
java.lang.String... keys)
Add a constraint to the given option set using the default multiplicity defined for this set
|
void |
init(Constrainable constrainable,
java.util.List<org.jdom.Element> list)
This method is used to initialize this constraint based on data read from an XML configuration
file.
|
boolean |
isSatisfied()
The actual check routine
|
boolean |
supports(Constrainable constrainable)
Indicates whether a constraint supports a given type of
Constrainable |
java.lang.String |
toString()
This is the overloaded
Object.toString() method |
public ExclusiveConstraint()
public void init(Constrainable constrainable, java.util.List<org.jdom.Element> list)
Constrainable
to which the constraint applies and a list of JDOM elements,
which contain the details about the constraint itself.
This method initializes the constraint and attaches it to the list of constraints
of the Constrainable
instance.
The parameters expected in the XML <param>
tags for this constraint
are
Name | Value | Status |
keys | Same as the keys
parameter in add(OptionSet, Options.Multiplicity, String[]) | Required |
mult | Same as the multiplicity
parameter in add(OptionSet, Options.Multiplicity, String[]) | Optional |
init
in interface XMLConstraint
constrainable
- The Constrainable
instance to which this constraint applieslist
- A list of JDOM elements to be used to initialize the constraint. Specifically,
these are tags of the form
<param name="..." value="..." />
containing key/value pairs with information.
public static void add(OptionSet optionSet, Options.Multiplicity multiplicity, java.lang.String... keys)
optionSet
- The OptionSet
to add this constraint tomultiplicity
- The Options.Multiplicity
to use for all options tied together by these constraints.
A Multiplicity
defined previously for any option contained in this constraint
is overridden.keys
- The keys of the options to tie together by this constraint. At least two keys
must be given here, and the corresponding options must already be defined in the set.public static void add(OptionSet optionSet, java.lang.String... keys)
optionSet
- The OptionSet
to add this constraint tokeys
- The keys of the options to tie together by this constraint. At least two keys
must be given here, and the corresponding options must already be defined in the set.public boolean supports(Constrainable constrainable)
Constrainable
supports
in interface Constraint
constrainable
- Constrainable
is supported. This constraint only
supports OptionSet
constrainablespublic boolean isSatisfied()
isSatisfied
in interface Constraint
public java.lang.String toString()
Object.toString()
method
toString
in class java.lang.Object