Why not? it's just the object reference that is local to the function.
The Map itself is not, and on the heap like everything else in the
JVM.

On Thu, May 16, 2013 at 2:19 AM, huangjia <cucumbergua...@gmail.com> wrote:
> Hi,
>
> I want to build a recommendation model based on Mahout. My dataset format
> is in the format of
>
> userID, itemID, rating timestamp tag1 tag2 tag3. Thus, I think I need to
> extend the FileDataModel.
>
> I looked into *JesterDataModel* as an example. However, I have a problem
> with the logic flow. In its *buildModel()* method, an empty map "data" is
> first constructed. It is then thrown into processFile. I assume that "data"
> is modified in this method, since later it is used to construct the
> GenericDataModel. However, "data" is a local variable instead of a class
> variable, so how is it modified?
>
> processFile(iterator, data, timestamps, false);
> return new GenericDataModel(GenericDataModel.toDataMap(data, true));
>
>
> --
> Jia

Reply via email to