Konstantina Panagiotopoulou <kwno...@hotmail.com> wrote on 06/07/2013
12:27:39 PM:
>
> So, I used the ateach statement and now I can fill the distributed
> array with my objects.
> BUT, I cannot access them.
> I tried the result() function of ArrayBuilder and just tried to
> print it with :
> Console.OUT.println(results(p).result())
> I get the reference of the object in the heap, but I cannot use the
> functions of my class (Tup) on it.
> So
> results(p).result().myfunct()
>
> does not compile.
ArrayBuilder.result() constructs and returns an Array. If you want to call
a function of Tup, you need to access it from the array. For example:
results(p).result()(0).myfunct()
It's hard to tell from just snippets of codes, but its not clear to me why
you are using a ArrayBuilder here. Each time you call result() on an
ArrayBuilder it will allocate a new Array and copy all the elements into
it. Is this what you want?
Do you actually want to end up with a DistArray[Tup] or a DistArray[Array
[Tup]] or what you have (a DistArray[ArrayBuilder[Tup]])?
If you need a variable and growable number of Tups in each element of the
DistArray, it might be more natural to use a DistArray[ArrayList[Tup]].
--dave
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users