| Package | alternativa.types |
| Class | public final dynamic class Set |
| Inheritance | Set flash.utils.Dictionary |
| Property | Defined by | ||
|---|---|---|---|
| length : uint [read-only] A quantity of objects in set.
| Set | ||
| Method | Defined 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 | ||
|
Add set.
| Set | ||
|
createFromArray(elements:Array, weakKeys:Boolean = false):Set
[static]The method creates a new set from elements of the array
| Set | ||
|
[static]Set difference.
| Set | ||
|
has(object:*):Boolean
Check set for object existence.
| Set | ||
|
Intersection with a set.
| 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 | ||
|
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 | ||
|
[static]A union of sets.
| Set | ||
| length | property |
length:uint [read-only]A quantity of objects in set.
Implementation public function get length():uint
| Set | () | constructor |
public function Set(weakKeys:Boolean = false)Create an instance of class.
ParametersweakKeys:Boolean (default = false) — if parameter is set to true, weak keys will be used |
| add | () | method |
public function add(object:*):voidAdd an object.
Parametersobject:* — 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():voidDelete all set elements.
| clone | () | method |
| concat | () | method |
public function concat(s:Set):voidAdd set.
Parameterss:Set — a set which elements are being added to a current set |
| createFromArray | () | method |
public static function createFromArray(elements:Array, weakKeys:Boolean = false):SetThe method creates a new set from elements of the array
Parameterselements:Array — the array of elements |
|
weakKeys:Boolean (default = false) — weak keys flag for the new set |
Set — a new set containing all elements from the array |
| difference | () | method |
public static function difference(a:Set, b:Set, weakKeys:Boolean = false):SetSet difference.
Parametersa:Set — a set from which elements are being subtracted |
|
b:Set — subtracting set |
|
weakKeys:Boolean (default = false) — weak keys flag for a new set |
Set — a new set containing objects from the a set, but excluding objects from the b set |
| has | () | method |
public function has(object:*):BooleanCheck set for object existence.
Parametersobject:* — object which is being checked for existence |
Boolean — true if the set contains the object, otherwise false |
| intersect | () | method |
public function intersect(s:Set):voidIntersection with a set.
Parameterss:Set — a 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):SetIntersection of sets.
Parametersa:Set — first set |
|
b:Set — second set |
|
weakKeys:Boolean (default = false) — weak keys flag for the new set |
Set — a new set containing all objects that belong to both a and b sets |
| isEmpty | () | method |
public function isEmpty():BooleanCheck set for elements existence.
ReturnsBoolean — true, if the set is empty, otherwise false |
| isSingle | () | method |
public function isSingle():BooleanCheck if set has only one element.
ReturnsBoolean — true, 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:*):voidDelete object.
Parametersobject:* — object that is being deleted |
| subtract | () | method |
public function subtract(s:Set):voidSet substraction.
Parameterss:Set — set, 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():ArrayTransfer set to array.
ReturnsArray — a new array filled with objects from the set |
| toString | () | method |
public function toString():StringString representation of set.
ReturnsString — string representation of the set |
| union | () | method |
public static function union(a:Set, b:Set, weakKeys:Boolean = false):SetA union of sets.
Parametersa:Set — first set |
|
b:Set — second set |
|
weakKeys:Boolean (default = false) — weak keys flag for a new set |
Set — a new set containing objects from both supplied sets |