[ 
https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244566#comment-13244566
 ] 

Josh Tynjala commented on FLEX-36:
----------------------------------

I guess using the top-level Array function to do the conversion to simply use 
an ArrayList or ArrayCollection is the obvious easy thing to do:

var myArray:Array = Array(myVector);

But it always feels weird not to have dedicated collections for Vectors. I 
realize that we can't type custom classes like collections, so we lose the 
advantage of vectors, but I always twitch a little when I need to first convert 
to an Array and then wrap in the collection. I'd be happy to do a code review.
                
> Add Vector implementations of IList and ICollectionView
> -------------------------------------------------------
>
>                 Key: FLEX-36
>                 URL: https://issues.apache.org/jira/browse/FLEX-36
>             Project: Apache Flex
>          Issue Type: Improvement
>            Reporter: Josh Tynjala
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>              Labels: List, collections
>
> VectorList and VectorCollection, similar to ArrayList and ArrayCollection. 
> Feels weird that I need to convert Vectors to Arrays to use in Flex 
> collections.
> In case anyone is unaware, you can cast Vector.<WhateverTypeYouWant> as 
> Vector.<*>. Works with the "as" and "is" keywords, as you can see below:
> var strings:Vector.<String> = new <String>["One", "Two", "Three"];
> trace(strings is Vector.<*>); //true
> var generic:Vector.<*> = strings as Vector.<*>;
> trace(strings) //One, Two, Three

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to