priyank
priyank

Reputation: 4724

How do I use hashset in actionscript

Right now I am using ArrayCollection. But I want to change that to Set as I want make sure do duplicate values come.

var addressList:ArrayCollection = new ArrayCollection();    

One way is I can use Dictionary and store addresses as a key. And I can just use keys to iterate. But I am looking for Java HashSet like implementation.

Upvotes: 0

Views: 3504

Answers (2)

Sean Fujiwara
Sean Fujiwara

Reputation: 4546

You want to download Polygonal Data Structures. The swc contains a HashSet. If you want Java-style template syntax for Flash, you should also check out Haxe.

Upvotes: 2

divillysausages
divillysausages

Reputation: 8033

The AS3 equivalent to HashMap or HashSet is the Dictionary class, and to a lesser extent, the Object class. Object keys are stored as strings, while with Dictionary the keys are objects. You can't have duplicate entries with either. Are you looking for a specific implementation other than that?

Upvotes: 0

Related Questions