public interface IntResultListener
The following contrived example will hopefully communicate its use more clearly than the previous paragraph of flowery prose:
public void doSomeStuff (IntResultListener listener) { Runnable run = new Runnable () { public void run () { try { // do our thing listener.requestCompleted(42); } catch (Exception e) { listener.requestFailed(e); } } }; new Thread(run).start(); }This interface is a convenience-variation on the plain old
ResultListener
, which communicates the result back in the form of an
Object
rather than an integer.Modifier and Type | Method and Description |
---|---|
void |
requestCompleted(int result)
Called to communicate that the request succeeded and that the
result is available.
|
void |
requestFailed(Exception cause)
Called to communicate that the request failed and to provide the
reason for failure.
|
void requestCompleted(int result)
void requestFailed(Exception cause)
Copyright © 2015. All rights reserved.