[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [dsdp-dd-dev] DSF Query object
|
Thanks for help..
Pawel Piech wrote:
Thanks Mikhail,
I would only add the Query object itself implements the
java.util.concurrent.Future interface which has the get() method
returning an object of type that comes from the generics parameter
(e.g. <Integer>).
Cheers,
Pawel
Mikhail Khodjaiants wrote:
Look at the "processCountRequest" method of one of the
DataGeneratorWith* classes. It uses "setData" method of
DataRequestMonitor to set the count.
------------------------------------------------------------------------
*From:* dsdp-dd-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx] *On Behalf Of *Serhat Aydin
*Sent:* Thursday, September 04, 2008 1:25 PM
*To:* Device Debugging developer discussions
*Subject:* [dsdp-dd-dev] DSF Query object
I am looking at the example code "SyncDataViewer" which is about DSF
Query object from the "Introduction to Programming vith DSF" tutorial.
// Create the query object for reading data count.
Query<Integer> countQuery = new Query<Integer>() {
@Override
protected void execute(DataRequestMonitor<Integer> rm) {
fDataGenerator.getCount(rm);
}
};
// Submit the query to be executed. A query implements a runnable
// interface and it has to be executed in order to do its work.
ImmediateExecutor.getInstance().execute(countQuery);
int count = 0;
// Block until the query completes, which will happen when the request
// monitor of the execute() method is marked done.
try {
count = countQuery.get();
} catch (Exception e) {
// InterruptedException and ExecutionException can be thrown here.
// ExecutionException containing a CoreException will be thrown
// if an error status is set to the Query's request monitor.
return new Object[0];
}
I could not understand that how *countQuery.get();* method gets the *count *value.* *Because in *IDataGeneration* interface *getCount* method returns void such as:
// Data access methods.
void getCount(DataRequestMonitor<Integer> rm);
--
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended
recipient, please notify the sender immediately and do not disclose
the contents to any other person, use it for any purpose, or store or
copy the information in any medium. Thank you.
------------------------------------------------------------------------
_______________________________________________
dsdp-dd-dev mailing list
dsdp-dd-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev
------------------------------------------------------------------------
_______________________________________________
dsdp-dd-dev mailing list
dsdp-dd-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev