Posted on 2007-09-05 16:06
G_G 阅读(289)
评论(0) 编辑 收藏 所属分类:
javascript Framework
1.ArrayList
<script type="text/javascript">
dojo.require("dojox.collections.ArrayList");
dojo.addOnLoad(function(){
var a = ['a1','a2'];
var arr = new dojox.collections.ArrayList(a);
arr.add('xx1');
arr.add('xx2');
arr.add('xx3');
//迭带
var it = arr.getIterator();
while(!it.atEnd()){
document.writeln( it.get());
}
//数量
document.writeln(arr.count);
//删除
arr.remove('xx1');
var arr_str = arr.toString()
document.writeln( arr_str );
});
</script>
与java的collections 很相同方法就不一一介绍了
addRange --add 集合
clear , clone , contains , indexOf , insert ,
item -- get(i),
removeAt(i),
reverse ???,
sort,
toArray . return object[]