Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 51
Registered: ‎09-18-2008
My Device: Not Specified

How to compare every items of a two vector(similarfilename).



How to compare two vector item.


I need to check for similar filenames


if similar filename(dont want to be upload) .


if not similar filename (upload)



Thanks in advance ....

Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How to compare every items of a two vector(similarfilename).

I just discovered the RIM Arrays class here,




you may be able to use something like this,


but I would try to find a way to do all the "real" searching and sorting in the Arrays class which presumably

is native code and doesn't have the Comparator stuff ( which of course is useful but as you can imagine

probalby hard for JVM to execute very quickly).


Obviously, with two sorted lists it is easy to find similar objects for closer comparison. In this case, it may be faster

to sort string hashes or millisecond dates rather than object pointers given possible overhead of the comparator

but it would depend on a lot of things too. Oddly enough, RIM even provides a "parallel" argument in Arrays.sort()

to facilitate this [ I was looking for something like a "sort order" array to index an unrelated object array but this works fine too, sometimes even the vendors get something right Smiley Happy ]


Anyway, this would seem to be a good package to think about if you need a small database like system too.