<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Collections API update</title>
	<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/</link>
	<description></description>
	<pubDate>Tue, 06 Jan 2009 23:36:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: eric</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127284</link>
		<pubDate>Mon, 20 Oct 2008 14:39:06 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127284</guid>
					<description>Hey Charisma,

You will get inconsistent results because internally, the HashMap utilizes a Dictionary object, thus when you invoke HashMapA.getEntries(); the  underlying algorithm uses a "for in" loop, which when used to iterate over an Object or Dictionary the order of the results returned are not guaranteed. 

Best,
Eric</description>
		<content:encoded><![CDATA[<p>Hey Charisma,</p>
<p>You will get inconsistent results because internally, the HashMap utilizes a Dictionary object, thus when you invoke HashMapA.getEntries(); the  underlying algorithm uses a &#8220;for in&#8221; loop, which when used to iterate over an Object or Dictionary the order of the results returned are not guaranteed. </p>
<p>Best,<br />
Eric
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: charisma</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127250</link>
		<pubDate>Mon, 20 Oct 2008 09:07:18 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127250</guid>
					<description>mapEntry = iList.getItemAt(i) as HashMapEntry;		
HashMapB = mapEntry.value;
tmpList = HashMapB.getEntries();
tmpListLen = tmpList.length;
trace("i -&#62; " + i + " " + mapEntry.key + " " + tmpListLen);

errr, i can't post my for-loop properly :(</description>
		<content:encoded><![CDATA[<p>mapEntry = iList.getItemAt(i) as HashMapEntry;<br />
HashMapB = mapEntry.value;<br />
tmpList = HashMapB.getEntries();<br />
tmpListLen = tmpList.length;<br />
trace(&#8221;i -&gt; &#8221; + i + &#8221; &#8221; + mapEntry.key + &#8221; &#8221; + tmpListLen);</p>
<p>errr, i can&#8217;t post my for-loop properly <img src='http://www.ericfeminella.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: charisma</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127248</link>
		<pubDate>Mon, 20 Oct 2008 09:04:46 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127248</guid>
					<description>Sorry, this should be the content of the for-loop:

for (var i:int=0; i " + i + " " + mapEntry.key + " " + tmpListLen);
}</description>
		<content:encoded><![CDATA[<p>Sorry, this should be the content of the for-loop:</p>
<p>for (var i:int=0; i &#8221; + i + &#8221; &#8221; + mapEntry.key + &#8221; &#8221; + tmpListLen);<br />
}
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: charisma</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127247</link>
		<pubDate>Mon, 20 Oct 2008 09:03:32 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-127247</guid>
					<description>Hmmm. In my code I got HashMap object and put it as a value inside another HashMap. Looks like this: HashMapA(key, HashMapB value).

Then i do:

var iList:IList = HashMapA.getEntries();
var iListLen:int = iList.length;
var mapEntry:HashMapEntry = null;

var tmpList:IList = null;			
var HashMapB:HashMap = null;
var tmpListLen:int = 0;

for (var i:int=0; i " + i + " " + mapEntry.key + " " + tmpListLen);
}

If you run this code repeatedly, you will notice that tmpListLen yields inconsistent results.</description>
		<content:encoded><![CDATA[<p>Hmmm. In my code I got HashMap object and put it as a value inside another HashMap. Looks like this: HashMapA(key, HashMapB value).</p>
<p>Then i do:</p>
<p>var iList:IList = HashMapA.getEntries();<br />
var iListLen:int = iList.length;<br />
var mapEntry:HashMapEntry = null;</p>
<p>var tmpList:IList = null;<br />
var HashMapB:HashMap = null;<br />
var tmpListLen:int = 0;</p>
<p>for (var i:int=0; i &#8221; + i + &#8221; &#8221; + mapEntry.key + &#8221; &#8221; + tmpListLen);<br />
}</p>
<p>If you run this code repeatedly, you will notice that tmpListLen yields inconsistent results.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: mark</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-125403</link>
		<pubDate>Wed, 08 Oct 2008 06:35:11 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-125403</guid>
					<description>One more thing - looking inside the HashMap class, I could not see any kind of hashing going on - or is that something built into Actionscript's property lookup mechanism?</description>
		<content:encoded><![CDATA[<p>One more thing - looking inside the HashMap class, I could not see any kind of hashing going on - or is that something built into Actionscript&#8217;s property lookup mechanism?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: mark</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-119379</link>
		<pubDate>Fri, 26 Sep 2008 06:01:04 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-119379</guid>
					<description>Thanks very much for these - saved me a lot of typing.

Small problem...

If I do something like mymap.put("hello", null) and then mymap.contains("hello"), it returns false. This is because for "contains()" you implemented it by checking the value in the dictionary.  Is it possible to change this so that contains() tests for the existing of the key rather than the null-ness of the value???

Would hasOwnProperty() do this???</description>
		<content:encoded><![CDATA[<p>Thanks very much for these - saved me a lot of typing.</p>
<p>Small problem&#8230;</p>
<p>If I do something like mymap.put(&#8221;hello&#8221;, null) and then mymap.contains(&#8221;hello&#8221;), it returns false. This is because for &#8220;contains()&#8221; you implemented it by checking the value in the dictionary.  Is it possible to change this so that contains() tests for the existing of the key rather than the null-ness of the value???</p>
<p>Would hasOwnProperty() do this???
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: charisma</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-119279</link>
		<pubDate>Thu, 25 Sep 2008 08:52:58 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-119279</guid>
					<description>HashMap utility is very helpful. Thanks!</description>
		<content:encoded><![CDATA[<p>HashMap utility is very helpful. Thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: eric</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-66771</link>
		<pubDate>Sun, 06 Jul 2008 15:41:38 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-66771</guid>
					<description>I have an entire codebase which contains all of my Open Source APIs as well as numerous other APIs which are not open source. This is entirely under version control and provides source access and distributions. If you are interested in the licensed version you can contact me directly

Thanks,
Eric</description>
		<content:encoded><![CDATA[<p>I have an entire codebase which contains all of my Open Source APIs as well as numerous other APIs which are not open source. This is entirely under version control and provides source access and distributions. If you are interested in the licensed version you can contact me directly</p>
<p>Thanks,<br />
Eric
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: jadd</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-65733</link>
		<pubDate>Sat, 05 Jul 2008 09:51:30 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-65733</guid>
					<description>hi Eric, 
and thanks for sharing your work. Could be nice to see all your code in a repository indeed, much easier to update for us.
Thanks.</description>
		<content:encoded><![CDATA[<p>hi Eric,<br />
and thanks for sharing your work. Could be nice to see all your code in a repository indeed, much easier to update for us.<br />
Thanks.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Luca</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-30985</link>
		<pubDate>Wed, 23 Apr 2008 09:43:08 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-30985</guid>
					<description>One problem with:
  getEntries() : IList;
(and the ArrayCollection) is that it introduces a dependency on the Flex framework, preventing the use of you HashMap in plain AS3 projects :(
Any chance of changing it to an Array?</description>
		<content:encoded><![CDATA[<p>One problem with:<br />
  getEntries() : IList;<br />
(and the ArrayCollection) is that it introduces a dependency on the Flex framework, preventing the use of you HashMap in plain AS3 projects <img src='http://www.ericfeminella.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Any chance of changing it to an Array?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: eric</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-20667</link>
		<pubDate>Thu, 03 Apr 2008 18:00:39 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-20667</guid>
					<description>Hey Maz,

I agree, for the most part these are common APIs one would expect to be included in the framework. The only reason I can think of as to why they are not included is to allow ActionScript 3 to align with the ECMA-262 edition 4 standard - which in many ways is very limiting.

- Eric</description>
		<content:encoded><![CDATA[<p>Hey Maz,</p>
<p>I agree, for the most part these are common APIs one would expect to be included in the framework. The only reason I can think of as to why they are not included is to allow ActionScript 3 to align with the ECMA-262 edition 4 standard - which in many ways is very limiting.</p>
<p>- Eric
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Maz</title>
		<link>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-19380</link>
		<pubDate>Wed, 02 Apr 2008 14:50:02 +0000</pubDate>
		<guid>http://www.ericfeminella.com/blog/2008/04/02/collections-api-update/#comment-19380</guid>
					<description>Thanks for the job Eric, those are the kind of things you wonder why they are not included in the framework...

{Maz}</description>
		<content:encoded><![CDATA[<p>Thanks for the job Eric, those are the kind of things you wonder why they are not included in the framework&#8230;</p>
<p>{Maz}
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
