| java.lang.Object ti.chimera.pref.ChoiceNodeContract
ChoiceNodeContract | public class ChoiceNodeContract implements ti.chimera.registry.NodeContract(Code) | | A
NodeContract which constrains the value to be a object matching
one of the specified objects.
author: ;Rob Clark;a0873619;San Diego;; version: 0.1 |
Constructor Summary | |
public | ChoiceNodeContract(Object[] choices) Class Constructor. | public | ChoiceNodeContract(Object[] choices, Object[] displayNames) Class Constructor.
Parameters: choices - the set of acceptible values Parameters: displayNames - the names to display to the user... |
Method Summary | |
public boolean | accepts(Object value) Determine if the specified value meets this contract. | public Object | getChoice(int idx) | public int | getChoicesCount() Get the number of valid choices. | public Object | getDisplayName(int idx) | public String | toString() The contract implementation should overload toString so
the contract can be displayed to the user in a sane format, for use
in error messages, etc. |
ChoiceNodeContract | public ChoiceNodeContract(Object[] choices)(Code) | | Class Constructor.
Parameters: choices - the set of acceptible values |
ChoiceNodeContract | public ChoiceNodeContract(Object[] choices, Object[] displayNames)(Code) | | Class Constructor.
Parameters: choices - the set of acceptible values Parameters: displayNames - the names to display to the user... the index intothis array should correspond to the index into choices array for the value corresponding to the display name. The displayname is simply used for an user interface constructed based on thiscontract. |
accepts | public boolean accepts(Object value)(Code) | | Determine if the specified value meets this contract.
Parameters: value - the value to check true if meets contract |
getChoice | public Object getChoice(int idx)(Code) | | Get the specified value
|
getChoicesCount | public int getChoicesCount()(Code) | | Get the number of valid choices.
the number of valid values |
getDisplayName | public Object getDisplayName(int idx)(Code) | | Get the specified display name
|
toString | public String toString()(Code) | | The contract implementation should overload toString so
the contract can be displayed to the user in a sane format, for use
in error messages, etc.
|
|
|