在黑莓的ArrayList实现 [英] Implementing ArrayList in Blackberry

查看:103
本文介绍了在黑莓的ArrayList实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,有在黑莓泛型的支持,但我想在黑莓使用ArrayList的。我已阅读,它可以实现在黑莓ArrayList中,我知道那几个人已经做到了。任何一个可以帮助我,告诉我,所有类从java.util包,以实现黑莓ArrayList中使用。通过应对来自java.util包所需的类在自己的BB包,然后使用该实现的可能。但我不知道所有的类来复制它。

I know that there is no support for Generics in Blackberry, but i want to use ArrayList in Blackberry. I have read that its possible to implement ArrayList in Blackberry, i know that few people have done that. Can any one please help me, by telling me which all classes to use from java.util package in order to implement ArrayList in Blackberry. Its possible by coping the required classes from java.util package in your own BB package and then use that implementation. But i am not sure which all classes to copy.

在此先感谢。
问候,
Varun的

Thanks in Advance. Regards, Varun

推荐答案

中为什么不使用矢量而不是的ArrayList 。从API的角度来看,这两个类非常相似。

Why not use Vector instead of ArrayList. From an API perspective, the two classes are very similar.

您需要注意以下记住

载体被同步。使用Vector的内容,任何方法是线程安全的。 的ArrayList ,在另一方面,是不同步的,因此,不是线程安全的。前有使用同步会导致性能命中。

Vectors are synchronized. Any method that uses the Vector's contents is thread safe. ArrayList, on the other hand, is unsynchronized,and therefore, not thread safe. There fore using synchronization will incur a performance hit.

这篇关于在黑莓的ArrayList实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆