My take on this is that there is many places where I'd like to avoid
JRE collections, but the basic JsArray is too much of a downgrade. I
don't mind changing it to <T> if it doesn't effect performance cause
then I could subclass it, but as an example of the stuff I would like
in a 'FastArrayList' that is not a collections derivative:

1) add() instead of just set(length(), item) (e.g. push)
2) addAll(anotherFastArrayList) (e.g. concat)
3) splice
4) toArray() (webmode is reinterpret cast op)
5) remove
6) shift/unshift (useful for queue when combined with pop)

I use the following pattern all over GQuery to avoid JRE collections
but preserve for-each

for(Foo f : fooList.elements()) { ... }

where fooList is my own JsArray<T> class, and elements() returns T[]
via reinterpret cast in webmode.

-Ray



On Thu, Jun 11, 2009 at 2:43 AM, Lex Spoon<sp...@google.com> wrote:
>
> Bah, mis-send.  What I was typing was:
>
>
>> I though the point was to get rid of JRE collections?  Anyway, the
>> collection in question is used as a queue.  I would hate to see its
>> performance get worse when there'
>
> ...when there's a known, straightforward alternative, and when that
> alternative provides a class people have been wanting for separate
> purposes.
>
>
> Lex
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to