Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the replication methods of Flex ArrayCollection in Flex

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces what are the replication methods of Flex ArrayCollection in Flex. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

Replication of Flex ArrayCollection in Flex

During the development of Flex, you often encounter the situation of copying Flex ArrayCollection. In the past, I just used to find a way to use it from the Internet, but I didn't specifically figure out why. When I have time today, I have studied it and summarized it as follows:

Replication in Flex, like java, is divided into deep replication and shallow replication.

◆ summarizes the shallow replication of Flex ArrayCollection. There are four methods:

1. VarnewArray:ListCollectionView=newListCollectionView (ListCollectionView (oldArray) .list)

2. VarnewArray:Flex ArrayCollection=newFlex ArrayCollection (oldArray.source)

3. VarnewArray:Flex ArrayCollection=newFlex ArrayCollection (oldArray.source.slice ())

4. VarnewArray:Flex ArrayCollection=newFlex ArrayCollection (oldArray.toArray ())

Among the above methods, * is not recommended because it is not a separate Flex ArrayCollection object created. The second, third and fourth methods are similar and can be used for reference.

Sometimes, we also use deep replication in ◆, as follows:

VarnewArray:Flex ArrayCollection=Flex ArrayCollection (this.clone (oldArray))

The this.clone () method is defined as follows:

Functionclone (source:Object): * {varmyBA:ByteArray=newByteArray (); myBA.writeObject (source); myBA.position=0; return (myBA.readObject ());} these are all the contents of the article "what are the ways to copy Flex ArrayCollection in Flex". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report