|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectti.chimera.pref.ChoiceNodeContract
A NodeContract
which constrains the value to be a object matching
one of the specified objects.
Field Summary |
Fields inherited from interface ti.chimera.registry.NodeContract |
BOOLEAN_CONTRACT, NULL_CONTRACT, NUMBER_CONTRACT, STRING_CONTRACT |
Constructor Summary | |
ChoiceNodeContract(java.lang.Object[] choices)
Class Constructor. |
|
ChoiceNodeContract(java.lang.Object[] choices,
java.lang.Object[] displayNames)
Class Constructor. |
Method Summary | |
boolean |
accepts(java.lang.Object value)
Determine if the specified value meets this contract. |
java.lang.Object |
getChoice(int idx)
Get the specified value |
int |
getChoicesCount()
Get the number of valid choices. |
java.lang.Object |
getDisplayName(int idx)
Get the specified display name |
java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ChoiceNodeContract(java.lang.Object[] choices)
choices
- the set of acceptible valuespublic ChoiceNodeContract(java.lang.Object[] choices, java.lang.Object[] displayNames)
choices
- the set of acceptible valuesdisplayNames
- the names to display to the user... the index into
this array should correspond to the index into choices
array for the value corresponding to the display name. The display
name is simply used for an user interface constructed based on this
contract.Method Detail |
public int getChoicesCount()
public java.lang.Object getChoice(int idx)
public java.lang.Object getDisplayName(int idx)
public boolean accepts(java.lang.Object value)
value
meets this contract.
accepts
in interface NodeContract
value
- the value to check
true
if meets contractpublic java.lang.String toString()
toString
so
the contract can be displayed to the user in a sane format, for use
in error messages, etc.
toString
in interface NodeContract
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |