|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectml.options.ExclusiveConstraint
public class ExclusiveConstraint
A constraint combining one or more options such that just one of them can occur. This type of constraint can only be added to an option set as it combines one or more options.
Constraints of this kind are also accounted for in the DefaultHelpPrinter
to format the output provided.
| Constructor Summary | |
|---|---|
ExclusiveConstraint()
The public no-org constructor. |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExclusiveConstraint()
| Method Detail |
|---|
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 XMLConstraintconstrainable - 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 Constraintconstrainable -
Constrainable is supported. This constraint only
supports OptionSet constrainablespublic boolean isSatisfied()
isSatisfied in interface Constraintpublic java.lang.String toString()
Object.toString() method
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||