aspose file tools*
The moose likes Java in General and the fly likes How to get Collection by value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get Collection by value?" Watch "How to get Collection by value?" New topic
Author

How to get Collection by value?

Shiva.Om Kumar
Ranch Hand

Joined: Jun 14, 2010
Posts: 68


How can I avoid changing data in y or how can I create new List (object) to assign at //2. ?

Thanks.....
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Change the reference. But why would you want something like this. I'm sure that this could be refactored to something that's much nicer.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Shiva.Om Kumar
Ranch Hand

Joined: Jun 14, 2010
Posts: 68
Thanks a lot for reply...

actually, x is my original object & y is similar object, I am carrying choices of user request and as per user choice updating data in y, but at any level user can undo all/any of his choices & in that case I need original data. Then further user can update his choice & undo the choice, until submit the final request.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Then look at the command pattern
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Collection by value?