Package | org.spicefactory.lib.collection |
Class | public class Set |
Inheritance | Set Object |
Due to limitations in the Flash Proxy class which only accepts String-based keys,
the Set
class does not support for
and for each
loops
or bracket access for reading and writing values. For loops you can loop over Set.toArray()
instead.
Method | Defined By | ||
---|---|---|---|
Set(items:Array = null)
Creates a new instance. | Set | ||
add(item:Object):Boolean
Adds the specified item to this set if it was not already present. | Set | ||
Clones this set. | Set | ||
contains(item:Object):Boolean
Indicates whether this set contains the specified item. | Set | ||
isEmpty():Boolean
Indicates whether this set is empty. | Set | ||
remove(item:Object):Boolean
Removes the specified item from this set. | Set | ||
removeAll():void
Removes all items from this set. | Set | ||
size():uint
Returns the number of items in this set. | Set | ||
toArray():Array
Returns the items of this set in no particular order as an Array. | Set |
Set | () | Constructor |
public function Set(items:Array = null)
Creates a new instance.
Parametersitems:Array (default = null ) — the items to populate the set with
|
add | () | method |
public function add(item:Object):Boolean
Adds the specified item to this set if it was not already present.
Parameters
item:Object — the item to add to this set
|
Boolean — true if the item was added to this set or false if it was already present
|
clone | () | method |
public function clone():Set
Clones this set. Modifications in the clone are not reflected in the original set and vice versa.
ReturnsSet — a clone of this set
|
contains | () | method |
public function contains(item:Object):Boolean
Indicates whether this set contains the specified item.
Parameters
item:Object — the item to check
|
Boolean — true if this set contains the specified item
|
isEmpty | () | method |
public function isEmpty():Boolean
Indicates whether this set is empty.
ReturnsBoolean — true if this set does not contain any items.
|
remove | () | method |
public function remove(item:Object):Boolean
Removes the specified item from this set.
Parameters
item:Object — the item to remove from this set
|
Boolean — true if the item was removed from this set or false if this set does not contain this item
|
removeAll | () | method |
public function removeAll():void
Removes all items from this set.
size | () | method |
public function size():uint
Returns the number of items in this set.
Returnsuint — the number of items in this set
|
toArray | () | method |
public function toArray():Array
Returns the items of this set in no particular order as an Array.
ReturnsArray — the items of this set as an Array
|