You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Josh Tynjala (Created) (JIRA)" <ji...@apache.org> on 2012/04/02 22:11:23 UTC
[jira] [Created] (FLEX-36) Add Vector implementations of IList and
ICollectionView
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
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
Re: [jira] [Issue Comment Edited] (FLEX-36) Add Vector
implementations of IList and ICollectionView
Posted by Taylor Brown <ta...@taytay.com>.
I've been happily using this VectorCollection and VectorList implementation
from David Beale for some time:
http://vectorcollection.riaforge.org/
It's licensed under the Apache license.
Doesn't sound like we have a shortage of code, but if you're comparing
implementations, I wanted to make sure the implementors saw it.
- Taylor
On Tue, Apr 3, 2012 at 6:14 AM, Saurabh Jain (Issue Comment Edited) (JIRA) <
jira@apache.org> wrote:
>
> [
> https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245017#comment-13245017]
>
> Saurabh Jain edited comment on FLEX-36 at 4/3/12 6:13 AM:
> ----------------------------------------------------------
>
> I have created a VectorUtil class some time back.
> May be you guys can have a look at it and see if this is useful
>
> http://saurabhpjain.wordpress.com/2012/04/03/flex-vector-util-class/
>
> was (Author: jainsaurabh86):
> I have created a VectorUtil class some time. May be you guys can have
> a look at it and see if this is useful
>
> http://saurabhpjain.wordpress.com/2012/04/03/flex-vector-util-class/
>
> > 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
>
>
>
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Josh Tynjala (Commented) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Josh Tynjala (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252833#comment-13252833 ]
Josh Tynjala commented on FLEX-36:
----------------------------------
I decided to do some further testing of Vector.<*>. I tried some similar code with a variety of data types, as shown below, and only the numeric types failed. That may not change anything, but it's worth noting, I think.
var doVector:Vector.<DisplayObject> = new <DisplayObject>[new Sprite(), new Shape(), new MovieClip()];
trace("display objects:", doVector, doVector as Vector.<*>);
//display objects: [object Sprite],[object Shape],[object MovieClip] [object Sprite],[object Shape],[object MovieClip]
var objectVector:Vector.<Object> = new <Object>[{}, {}, {}];
trace("objects:", objectVector, objectVector as Vector.<*>);
//objects: [object Object],[object Object],[object Object] [object Object],[object Object],[object Object]
var boolVector:Vector.<Boolean> = new <Boolean>[true, true, false];
trace("booleans:", boolVector, boolVector as Vector.<*>);
//booleans: true,true,false true,true,false
var stringVector:Vector.<String> = new <String>["One", "Two", "Three"];
trace("strings:", stringVector, stringVector as Vector.<*>);
//strings: One,Two,Three One,Two,Three
var numberVector:Vector.<Number> = new <Number>[1, 2, 3];
trace("numbers:", numberVector, numberVector as Vector.<*>);
//numbers: 1,2,3 null
var intVector:Vector.<int> = new <int>[-1, 0, 1];
trace("ints", intVector, intVector as Vector.<*>);
//ints -1,0,1 null
var uintVector:Vector.<uint> = new <uint>[1, 2, 3];
trace("uints", uintVector, uintVector as Vector.<*>);
//uints 1,2,3 null
var xmlVector:Vector.<XML> = new <XML>[<one>one</one>, <two>two</two>, <three>three</three>];
trace("xml", xmlVector, xmlVector as Vector.<*>);
//xml one,two,three one,two,three
> 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
[jira] [Issue Comment Edited] (FLEX-36) Add Vector implementations
of IList and ICollectionView
Posted by "Saurabh Jain (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245017#comment-13245017 ]
Saurabh Jain edited comment on FLEX-36 at 4/3/12 6:13 AM:
----------------------------------------------------------
I have created a VectorUtil class some time back.
May be you guys can have a look at it and see if this is useful
http://saurabhpjain.wordpress.com/2012/04/03/flex-vector-util-class/
was (Author: jainsaurabh86):
I have created a VectorUtil class some time. May be you guys can have a look at it and see if this is useful
http://saurabhpjain.wordpress.com/2012/04/03/flex-vector-util-class/
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247419#comment-13247419 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
My VectorCollection and VectorList are now in my whiteboard. Take a look at these. There is one issue, which is the need to internationalize the error message. This still needs to be completed.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247420#comment-13247420 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
p.s. Additionally, we need to decide on where to upload the unit tests associated with this code as I have a complete set of tests. Comments and critiques welcome.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Saurabh Jain (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245017#comment-13245017 ]
Saurabh Jain commented on FLEX-36:
----------------------------------
I have created a VectorUtil class some time. May be you guys can have a look at it and see if this is useful
http://saurabhpjain.wordpress.com/2012/04/03/flex-vector-util-class/
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247442#comment-13247442 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
Seems reasonable. I will get the tests in tonight.
> 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
RE: [jira] [Commented] (FLEX-36) Add Vector implementations of
IList and ICollectionView
Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
Grumble. Somehow managed not to push those.
Will get them up there.
Mike
-----Original Message-----
From: Justin Mclean [mailto:justin@classsoftware.com]
Sent: Friday, April 06, 2012 5:03 PM
To: flex-dev@incubator.apache.org
Subject: Re: [jira] [Commented] (FLEX-36) Add Vector implementations of IList and ICollectionView
Hi,
> Checked in. Review me.
Didn't you mention there were some units tests?
Thanks,
Justin
RE: [jira] [Commented] (FLEX-36) Add Vector implementations of
IList and ICollectionView
Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>Didn't you mention there were some units tests?
>Unit tests are checked in now.
As one more addition to this, I also ported these test over to ArrayCollection and ArrayList which will give us some tests for both of those as well. The real work will be creating a good set of tests for ListCollectionView.
Mike
RE: [jira] [Commented] (FLEX-36) Add Vector implementations of
IList and ICollectionView
Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>Didn't you mention there were some units tests?
Unit tests are checked in now.
These tests require:
Flexunit-4.1.0
Hamcrest-AS3 1.1.3
Mockolate 0.12.4
(Actually the mockolate stuff isn't checked in until we resolve the whole serialization question, but it will be required for those tests)
Have a look around. There are 70 passing tests if all work. I also have a tweak ArrayList in my whiteboard. It's a minor change to the type int to uint in one method.
Mike
Re: [jira] [Commented] (FLEX-36) Add Vector implementations of IList and ICollectionView
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> Checked in. Review me.
Didn't you mention there were some units tests?
Thanks,
Justin
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13248885#comment-13248885 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
Checked in. Review me.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244571#comment-13244571 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
yep, agree completely. I wrote it so that I could keep vectors the original vectors typed even if the interface demands that we abstract it for use in controls.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Omar Gonzalez (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244543#comment-13244543 ]
Omar Gonzalez commented on FLEX-36:
-----------------------------------
I also have an implementation of this along with a VectorUtil that has some things for converting Vectors to both Arrays and Dictionaries. I'd love to compare implementations and see if there's anything we can put together.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Omar Gonzalez (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247435#comment-13247435 ]
Omar Gonzalez commented on FLEX-36:
-----------------------------------
Cool, I'll update my repo and take a peek tonight. When I added the start to a spark string validator I just made a tests folder next to the src folder for the component in the whiteboard. I think we can move those tests to their final location whenever its time to move the code into the actual SDK. It makes it easy to isolate tests for individual things in the whiteboard.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249462#comment-13249462 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
No worries. I was excited too. Thought I could make my code a little cleaner... alas, its back to the ugly way
> 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
[jira] [Issue Comment Edited] (FLEX-36) Add Vector implementations
of IList and ICollectionView
Posted by "Omar Gonzalez (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244562#comment-13244562 ]
Omar Gonzalez edited comment on FLEX-36 at 4/2/12 8:28 PM:
-----------------------------------------------------------
Yea I feel the same, the implementation around the Vector typing has some... issues. So I felt like I was hacking it together the whole way through because of the typing doesn't behave as expected.
was (Author: s9tpepper):
Yea I feel the same, the implementation around the Vector typing has some... issues. So I felt like I was hacking it together the whole way through because of the typing does behave as expected.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249440#comment-13249440 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
It should be noted that the casts mentioned by Josh seem to be a special case for string and do not work in the cast majority of cases. See below:
var strings:Vector.<String> = new <String>["One", "Two", "Three"];
trace(strings is Vector.<*>); //true
var generic:Vector.<*> = strings as Vector.<*>;
trace(generic) //One, Two, Three
var ints:Vector.<int> = new <int>[1,2,3];
trace(ints is Vector.<*>); //false
generic = ints as Vector.<*>;
trace(generic) //null
var numbers:Vector.<Number> = new <Number>[1,2,3];
trace(numbers is Vector.<*>); //false
generic = numbers as Vector.<*>;
trace(generic) //null
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244546#comment-13244546 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
Sounds great. I will get mine up into my whiteboard soon. I just appreciate a second set of eyes to see if there are better approaches anywhere.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Michael Labriola (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244542#comment-13244542 ]
Michael Labriola commented on FLEX-36:
--------------------------------------
I have this code complete along with unit tests. Wasn't aware there was interest. Josh, are you willing to do a code review of it?
Mike
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Omar Gonzalez (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244562#comment-13244562 ]
Omar Gonzalez commented on FLEX-36:
-----------------------------------
Yea I feel the same, the implementation around the Vector typing has some... issues. So I felt like I was hacking it together the whole way through because of the typing does behave as expected.
> 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
[jira] [Commented] (FLEX-36) Add Vector implementations of IList
and ICollectionView
Posted by "Josh Tynjala (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FLEX-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249456#comment-13249456 ]
Josh Tynjala commented on FLEX-36:
----------------------------------
Oh, wonderful. I love weird special cases. Sorry about that.
> 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