Use settable.set(null)
to set Settable<Void>
to the ready state.
Settable is frequently used to return data from code contained in anonymous classes. For example:
Promise<Integer> foo() { final Settable<Integer> result = new Settable<Integer>(); new TryCatch() { protected void doTry() throws Throwable { Promise<Integer> activity1Result = activities.callActivity1(); result.chain(activity1Result); } protected void doCatch(Throwable e) throws Throwable { Promise<Void> handled = handleFailure(e); rethrow(e, handled); } }; return result; }
@param < V> The type of value accepted and returned by this Settable.Use {@link Void} to represent Promise that indicates completion ofoperation that doesn't return a value.
In addition, an attribute class that implements this interface needs to maintain a list of listeners that are informed whenever the value of the attribute changes. It should inform those listeners whenever setExpression() is called.
Among other uses, this interface marks attributes whose value can be set via the value attribute of a MoML property element. For example, if class XXX implements Settable, then the following is valid MoML:
<property name="xxx" class="XXX" value="yyy"/>
This interface also supports annotations that hint to a user interface the level of visibility that an instance should have. The visibility is specified as one of the static instances of the inner class Visibility, currently NONE, EXPERT, FULL, and NOT_EDITABLE NONE indicates that the user should never see the instance, and should not be able to set its value through the user interface. EXPERT means that only expert users should see the instance. FULL means that the instance is always visible, and a user interface should always allow it to be set. NOT_EDITABLE is similar to FULL, except that the value of the expression is visible, but not editable by the user. This is commonly used for feedback from the model. @author Edward A. Lee @version $Id: Settable.java,v 1.32 2006/09/21 15:09:38 cxh Exp $ @since Ptolemy II 1.0 @Pt.ProposedRating Green (eal) @Pt.AcceptedRating Green (cxh)
|
|
|
|
|
|
|
|
|
|