Packagealternativa.types
Classpublic final dynamic class Set
InheritanceSet Inheritance flash.utils.Dictionary

A set of elements.



Public Properties
 PropertyDefined by
  length : uint
[read-only] A quantity of objects in set.
Set
Public Methods
 MethodDefined by
  
Set(weakKeys:Boolean = false)
Create an instance of class.
Set
  
add(object:*):void
Add an object.
Set
  
any():*
Get any object.
Set
  
clear():void
Delete all set elements.
Set
  
Clone set.
Set
  
concat(s:Set):void
Add set.
Set
  
createFromArray(elements:Array, weakKeys:Boolean = false):Set
[static]The method creates a new set from elements of the array
Set
  
difference(a:Set, b:Set, weakKeys:Boolean = false):Set
[static]Set difference.
Set
  
has(object:*):Boolean
Check set for object existence.
Set
  
intersect(s:Set):void
Intersection with a set.
Set
  
intersection(a:Set, b:Set, weakKeys:Boolean = false):Set
[static]Intersection of sets.
Set
  
isEmpty():Boolean
Check set for elements existence.
Set
  
isSingle():Boolean
Check if set has only one element.
Set
  
peek():*
Get some map object.
Set
  
remove(object:*):void
Delete object.
Set
  
subtract(s:Set):void
Set substraction.
Set
  
take():*
Get some object and delete it from the set.
Set
  
toArray():Array
Transfer set to array.
Set
  
toString():String
String representation of set.
Set
  
union(a:Set, b:Set, weakKeys:Boolean = false):Set
[static]A union of sets.
Set
Property detail
lengthproperty
length:uint  [read-only]

A quantity of objects in set.

Implementation
    public function get length():uint
Constructor detail
Set()constructor
public function Set(weakKeys:Boolean = false)

Create an instance of class.

Parameters
weakKeys:Boolean (default = false)if parameter is set to true, weak keys will be used
Method detail
add()method
public function add(object:*):void

Add an object.

Parameters
object:*an object that is being added
any()method 
public function any():*

Get any object.

Returns
*any object of the map
clear()method 
public function clear():void

Delete all set elements.

clone()method 
public function clone():Set

Clone set.

Returns
Seta set including all objects from the source set
concat()method 
public function concat(s:Set):void

Add set.

Parameters
s:Seta set which elements are being added to a current set
createFromArray()method 
public static function createFromArray(elements:Array, weakKeys:Boolean = false):Set

The method creates a new set from elements of the array

Parameters
elements:Arraythe array of elements
 
weakKeys:Boolean (default = false)weak keys flag for the new set

Returns
Seta new set containing all elements from the array
difference()method 
public static function difference(a:Set, b:Set, weakKeys:Boolean = false):Set

Set difference.

Parameters
a:Seta set from which elements are being subtracted
 
b:Setsubtracting set
 
weakKeys:Boolean (default = false)weak keys flag for a new set

Returns
Seta new set containing objects from the a set, but excluding objects from the b set
has()method 
public function has(object:*):Boolean

Check set for object existence.

Parameters
object:*object which is being checked for existence

Returns
Booleantrue if the set contains the object, otherwise false
intersect()method 
public function intersect(s:Set):void

Intersection with a set.

Parameters
s:Seta set which is being intersected. Only elements that are present in current set and in s set will left.
intersection()method 
public static function intersection(a:Set, b:Set, weakKeys:Boolean = false):Set

Intersection of sets.

Parameters
a:Setfirst set
 
b:Setsecond set
 
weakKeys:Boolean (default = false)weak keys flag for the new set

Returns
Seta new set containing all objects that belong to both a and b sets
isEmpty()method 
public function isEmpty():Boolean

Check set for elements existence.

Returns
Booleantrue, if the set is empty, otherwise false
isSingle()method 
public function isSingle():Boolean

Check if set has only one element.

Returns
Booleantrue, if the set contains single object, otherwise false
peek()method 
public function peek():*

Get some map object.

Returns
*a value from the map
remove()method 
public function remove(object:*):void

Delete object.

Parameters
object:*object that is being deleted
subtract()method 
public function subtract(s:Set):void

Set substraction.

Parameters
s:Setset, objects of which are being deleted from current set
take()method 
public function take():*

Get some object and delete it from the set.

Returns
*a value from the map
toArray()method 
public function toArray():Array

Transfer set to array.

Returns
Arraya new array filled with objects from the set
toString()method 
public function toString():String

String representation of set.

Returns
Stringstring representation of the set
union()method 
public static function union(a:Set, b:Set, weakKeys:Boolean = false):Set

A union of sets.

Parameters
a:Setfirst set
 
b:Setsecond set
 
weakKeys:Boolean (default = false)weak keys flag for a new set

Returns
Seta new set containing objects from both supplied sets