计算字典长度的Flex [英] Calculating Dictionary length in Flex

查看:179
本文介绍了计算字典长度的Flex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是计算在Flex中Dictionary对象的长度,最好的方法是什么?

What's the best way to calculate the length of a Dictionary object in Flex?

var d:Dictionary = new Dictionary();
d["a"] = "alpha";
d["b"] = "beta";

我要检查它应该是2本字典的长度。有没有办法做到这一点除了通过对象循环?

I want to check the length which should be 2 for this Dictionary. Is there any way to do it other than looping through the objects?

推荐答案

没有,有没有办法来检查对象的长度(意思是pretty的多,支持非字符串键的对象)比循环等通过元素

No, there is no way to check the length of an object(Dictionary is pretty much an object that supports non-String keys) other than looping through the elements.

<一个href="http://www.flexer.info/2008/07/31/how-to-find-an-objects-length/">http://www.flexer.info/2008/07/31/how-to-find-an-objects-length/

您可能不担心检查,如果该属性是内部的。

You probably don't have to worry about checking if the property is an internal one.

这篇关于计算字典长度的Flex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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