Re: [android-developers] Re: IndexOf on the toString Value of a object?
Also you can
1 - redefine the equals method on your object.
2 - use java.util.Collections and a comparator.
In both cases you meed to pass an instance of your object with, at least, the string attribute setted.
On Aug 28, 2011 12:12 PM, "blake" <blake.meike@gmail.com> wrote:
> Use a Map. See java.util.Map and java.util.HashMap
>
> -blake
>
> On Aug 28, 6:59 am, Boozel <boozelcl...@gmail.com> wrote:
>> Hi
>>
>> I have a list of objects and i need to search through it to find a specific
>> object.
>> The objects have a String name property and i want to find an object with
>> the same name as my query string.
>>
>> Is there anyway yo do this using the indexOf method or do i need to create
>> my own using a for loop.
>> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
-- > Use a Map. See java.util.Map and java.util.HashMap
>
> -blake
>
> On Aug 28, 6:59 am, Boozel <boozelcl...@gmail.com> wrote:
>> Hi
>>
>> I have a list of objects and i need to search through it to find a specific
>> object.
>> The objects have a String name property and i want to find an object with
>> the same name as my query string.
>>
>> Is there anyway yo do this using the indexOf method or do i need to create
>> my own using a for loop.
>> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home