|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Untamed: A ValueGuard will either coerce an input to a value that matches some condition, or it will fail. A ValueGuard is used in the E language to guard the return value of a method. It is also used both in E and ELib as an argument to a SlotGuardTemplate and a ValueGuardTemplate.
Method Summary | |
Object |
coerce(Object specimen,
OneArgFunc optEjector)
Enabled: If specimen coerces to a value that matches the condition represented by this guard, return that value; other fail (according to optEjector) with a problem explaining why not. |
String |
getName()
Enabled: All E guards should respond to "getName()" |
Method Detail |
public Object coerce(Object specimen, OneArgFunc optEjector)
If optEjector is null, then throw the problem. Otherwise, call optEjector with the problem. optEjector should perform a non-local exit, and so should not return. If optEjector returns anyway, then throw the problem after all.
A note to Java implementors of this method: You almost certainly want to start your method with
specimen = Ref.resultion(specimen);
public String getName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |