Packagecom.bourre.collection
Classpublic class Set
ImplementsList, TypedContainer

Player version: Flash Player 9.0
Language version: ActionScript 3.0

A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1 === e2, and at most one null element. As implied by its name, this interface models the mathematical set abstraction.

The Set class places additional stipulations, beyond those inherited from the Collection interface, on the contracts of the constructor and on the contracts of the add method. Declarations for other inherited methods are also included here for convenience. (The specifications accompanying these declarations have been tailored to the Set class, but they do not contain any additional stipulations.)

The additional stipulation on constructors is, not surprisingly, that all constructors must create a set that contains no duplicate elements (as defined above).

Some set implementations have restrictions on the elements that they may contain. For example, some implementations prohibit null elements, and some have restrictions on the types of their elements. Attempting to add an ineligible element throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible element may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible element whose completion would not result in the insertion of an ineligible element into the set may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as "optional" in the specification for this class.


Example
Using an untyped Set
  var set : Set = new Set();
  
  set.add( "foo" );
  set.add( 25 );
  
  trace ( set.add( 25 ) ) // false, as the object already exist in this set
  
  set.add( false );
  
  trace( set.size() ); // 3
  
Using a typed Set
  var set : Set = new Set( String );
  
  set.add( "foo" );
  
  try
  {
   set.add( 25 ); // throw an error, as 25 is not a String
  }
  catch( e : Error ) {}
  
  trace ( set.add( "foo" ); ) // false, as the object already exist in this set
  
  set.add( "hello" );
  
  trace( set.size() ); // 2
  

See also

Collection.html
TypedContainer.html


Protected Properties
 PropertyDefined by
  _aSet : Array
Set
  _oType : Class
Set
Public Methods
 MethodDefined by
  
Set(type:Class = null)
Creates a new set object.
Set
  
add(o:Object):Boolean
Adds the specified element to this set if it is not already present (optional operation).
Set
  
addAll(c:Collection):Boolean
Adds all of the elements in the specified Collection to this set if they're not already present (optional operation).
Set
  
addAllAt(index:uint, c:Collection):Boolean
Inserts all of the elements in the specified Collection into this set at the specified position.
Set
  
addAt(index:uint, o:Object):void
Inserts the specified element at the specified position in this set.
Set
  
clear():void
Removes all of the elements from this set (optional operation).
Set
  
contains(o:Object):Boolean
Returns true if this set contains the specified element.
Set
  
Returns true if this set contains all of the elements of the specified collection.
Set
  
equals(o:Object):Boolean
Compares the specified object with this set for equality.
Set
  
get(index:uint):Object
Returns the Object stored at the passed-in index in this set object.
Set
  
getType():Class
Return the class type of element in this set object.
Set
  
indexOf(o:Object):int
Returns the index of the object in this set
Set
  
isEmpty():Boolean
Returns true if this set contains no elements.
Set
  
isTyped():Boolean
Returns true if this set perform a verification of the type of elements.
Set
  
Verify that the passed-in Collection is a valid collection for use with the addAll, removeAll, retainAll and containsAll methods.
Set
  
isValidIndex(index:uint):void
Verify that the passed-in uint index is a valid index for this Set.
Set
  
isValidIndexForAdd(index:uint):void
Verify that the passed-in uint index is a valid index for an insertion in this Set.
Set
  
isValidObject(o:Object):Boolean
Verify that the passed-in object is valid for this Set (well-typed, not already present in the set).
Set
  
isValidType(o:Object):Boolean
Verify that the passed-in object type match the current Set element's type.
Set
  
Returns an iterator over the elements in this set.
Set
  
lastIndexOf(o:Object):int
Returns the index of the last occurrence of the specified object in this Set.
Set
  
listIterator(index:uint = 0):ListIterator
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
Set
  
matchType(o:*):Boolean
Verify that the passed-in object type match the current set element's type.
Set
  
remove(o:Object):Boolean
Removes the specified element from this set if it is present (optional operation).
Set
  
removeAll(c:Collection):Boolean
Removes from this set all of its elements that are contained in the specified collection (optional operation).
Set
  
removeAt(o:Object):Boolean
Removes the element at the specified position in this set.
Set
  
retainAll(c:Collection):Boolean
Retains only the elements in this set that are contained in the specified collection (optional operation).
Set
  
set(index:uint, o:Object):Object
Insert the passed-in Object in this set at the specified index.
Set
  
size():uint
Returns the number of elements in this set (its cardinality).
Set
  
subList(fromIndex:uint, toIndex:uint):List
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
Set
  
swap(index1:uint, index2:uint):void
Swap two objects stored in the passed-in index

If the passed-in index are not valid index for this set, the function throw an IndexOutOfBoundsException exception.

Set
  
toArray():Array
Returns an array containing all the elements in this set.
Set
  
toString():String
Returns the String representation of this object.
Set
Property detail
_aSetproperty
protected var _aSet:Array

Player version: Flash Player 9.0
Language version: ActionScript 3.0

_oTypeproperty 
protected var _oType:Class

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Constructor detail
Set()constructor
public function Set(type:Class = null)

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Creates a new set object. If the type argument is defined, the set is considered as typed, and then the type of all elements inserted in this set is checked.

Parameters
type:Class (default = null)Class type for elements of this set
Method detail
add()method
public function add(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element, o, to this set if this set contains no element e such that o === e. If this set already contains the specified element, the call leaves this set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throwing an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the the elements that they may contain.

Parameters
o:Object — element to be added to this set.

Returns
Booleantrue if this set did not already contain the specified element.

Throws
ClassCastException — If the object's type prevents it to be added into this set

Example
How to use the Set.add method
   var set : Set = new Set( String );
   
   set.add( "foo" );
   
   set.add( "foo" ); // return false, as 'foo' already exist in this set
   
   set.add( 25 ); // throw a ClassCastException, as 25 is not a string 
   
In comparison with Java, where object which have all of their properties equals are considered as equals, AS3 doesn't allow that, except if objects provides an equals method which is used instead of the == or === operators. Nevertheless, the Set class use the native operator to perform comparison, thus two objects with equals properties are considered as differents.
   var set : Set = new Set( Object );
   var o : Object = { x : 50, y : 100 };
   
   set.add( o ); 
   set.add( o ); // return false, as o' already exist in this set
   
   set.add( { x : 50, y : 100 } ); // return true, as the argument is not
              // the same object than o, even if all
              // their properties are equals
   

addAll()method 
public function addAll(c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds all of the elements in the specified Collection to this set if they're not already present (optional operation). If the specified collection is also a set, the addAll operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.

The rules which govern collaboration between typed and untyped Collection are described in the isValidCollection descrition, all rules described there are supported by the addAll method.

Parameters
c:CollectionCollection whose elements are to be added to this set.

Returns
Booleantrue if this set changed as a result of the call.

Throws
ClassCastException — If the object's type prevents it to be added into this set
 
IllegalArgumentException — If the passed-in collection type is not the same that the current one.

See also


Example
How the Set.addAll method works with types

Let say that you have two typed sets typedSet1 and typedSet1.

   var typedSet1 : Set = new Set( String );
   var typedSet2 : Set = new Set( String );
   
   typedSet1.add( "foo1" );
   typedSet1.add( "foo2" );
   typedSet1.add( "foo3" );
   typedSet1.add( "foo4" );
   
   typedSet2.add( "foo3" );
   typedSet2.add( "foo4" );
   typedSet2.add( "foo5" );
   typedSet2.add( "foo6" );
   
And two untyped sets untypedSet1 and untypedSet1.
   var untypedSet1 : Set = new Set();
   var untypedSet2 : Set = new Set();
   
   untypedSet1.add( 1 );
   untypedSet1.add( 2 );
   untypedSet1.add( 3 );
   untypedSet1.add( "foo1" );
   
   untypedSet1.add( 3 );
   untypedSet1.add( 4 );
   untypedSet1.add( 5 );
   untypedSet1.add( "foo1" );
   
The two operations below will work as expected, realizing an union between Sets objects.
   
   typedSet1.addAll ( typedSet2 );
   // will produce a set containing : 
   // 'foo1'
   // 'foo2'
   // 'foo3'
   // 'foo4'
   // 'foo5'
   // 'foo6'
   
   untypedSet1.addAll ( untypedSet2 );
   // will produce a set containing : 
   // 'foo1'
   // 1
   // 2
   // 3
   // 4
   // 5
   
As an untyped set can contain any types of objects at the same time, the code below is always valid.
   untypedSet1.addAll( typedSet2 );
   // will produce a set containing : 
   // 'foo1'
   // 'foo3'
   // 'foo4'
   // 'foo5'
   // 'foo6'
   // 1
   // 2
   // 3
   // 4
   // 5
   
But if you try to add an untyped collection to a typed one the call will fail with an exception.
   try
   {
    typedSet2.addAll( untypedSet2 );
   }
   catch( e : IllegalArgumentException )
   {
    trace( e ); 
    // The passed-in collection with type 'null' has not the same type 
    // than com.bourre.collections::Set<String>
   }
   

addAllAt()method 
public function addAllAt(index:uint, c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Inserts all of the elements in the specified Collection into this set at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the stack in the order that they are returned by the specified Collection's iterator.

The rules which govern collaboration between typed and untyped Collection are described in the isValidCollection descrition, all rules described there are supported by the containsAll method.

Parameters
index:uint — index uint index at which to insert first element from the specified collection.
 
c:Collection — c elements to be inserted into this stack.

Returns
Booleantrue if this set changed as a result of the call.

Throws
IndexOutOfBoundsException — index is out of range (index < 0 || index > size()).
 
ClassCastException — if the class of an element of the specified collection prevents it from being added to this collection.
 
NullPointerException — if the passed in collection is null.

See also

addAt()method 
public function addAt(index:uint, o:Object):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Inserts the specified element at the specified position in this set. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:uintuint index at which the specified element is to be inserted.
 
o:Object — element to be inserted.

Throws
IndexOutOfBoundsException — index is out of range (index < 0 || index > size()).
 
ClassCastException — if the class of the specified element prevents it from being added to this list.

See also

clear()method 
public function clear():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes all of the elements from this set (optional operation). This set will be empty after this call returns (unless it throws an exception).

contains()method 
public function contains(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that o === e.

Parameters
o:ObjectObject whose presence in this set is to be tested.

Returns
Booleantrue if this set contains the specified element.

Throws
ClassCastException — If the object's type prevents it to be added into this set
containsAll()method 
public function containsAll(c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this set contains all of the elements of the specified collection. If the specified collection is also a Set, this method returns true if it is a subset of this set.

The rules which govern collaboration between typed and untyped Collection are described in the isValidCollection descrition, all rules described there are supported by the containsAll method.

Parameters
c:CollectionCollection to be checked for containment in this set.

Returns
Booleantrue if this set contains all of the elements of the specified collection.

Throws
NullPointerException — if the specified collection is null.
 
IllegalArgumentException — If the passed-in collection type is not the same that the current one.

See also

equals()method 
public function equals(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Compares the specified object with this set for equality. Returns true if the specified object is also a Set, the two sets have the same size, and every member of the specified Set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set class.

Parameters
o:ObjectObject to be compared for equality with this set.

Returns
Booleantrue if the specified Object is equal to this set.
get()method 
public function get(index:uint):Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the Object stored at the passed-in index in this set object.

If the passed-in index is not a valid index for this set, the function throw an IndexOutOfBoundsException exception.

Parameters
index:uintuint index of the entry to get.

Returns
ObjectObject stored at the specified index

Throws
IndexOutOfBoundsException — The passed-in index is not a valid index for this set
getType()method 
public function getType():Class

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Return the class type of element in this set object.

An untyped set returns null, as the wildcard type (/code>) is not a Class and Object class doesn't fit for primitive types.

Returns
ClassClass type of the set's elements
indexOf()method 
public function indexOf(o:Object):int

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the index of the object in this set

Parameters
o:Object — the object to find

Returns
intint index of the passed object in this set, either if the object isn't contained in this set the function return -1

Throws
ClassCastException — If the object's type prevents it to be added into this stack
isEmpty()method 
public function isEmpty():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this set contains no elements.

Returns
Booleantrue if this set contains no elements.
isTyped()method 
public function isTyped():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this set perform a verification of the type of elements.

Returns
Booleantrue if this set perform a verification of the type of elements.
isValidCollection()method 
public function isValidCollection(c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in Collection is a valid collection for use with the addAll, removeAll, retainAll and containsAll methods.

When dealing with typed and untyped collection, the following rules apply :

  • Two typed collection, which have the same type, can collaborate each other.
  • Two untyped collection can collaborate each other.
  • An untyped collection can add, remove, retain or contains any typed collection of any type without throwing errors.
  • A typed collection will always fail when attempting to add, remove, retain or contains an untyped collection.

If the passed-in Collection is null the method throw a NullPointerException error.

Parameters
c:CollectionCollection to verify

Returns
Boolean — boolean true if the collection is valid, either false

Throws
NullPointerException — If the passed-in collection is null
 
IllegalArgumentException — If the passed-in collection type is not the same that the current one.

See also

isValidIndex()method 
public function isValidIndex(index:uint):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in uint index is a valid index for this Set. If not, an IndexOutOfBoundsException exception is thrown.

Parameters
index:uintuint index to verify

Throws
IndexOutOfBoundsException — The passed-in index is not a valid index for this set
isValidIndexForAdd()method 
public function isValidIndexForAdd(index:uint):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in uint index is a valid index for an insertion in this Set. If not, an IndexOutOfBoundsException exception is thrown.

Parameters
index:uintuint index to verify

Throws
IndexOutOfBoundsException — The passed-in index is not a valid index for this set
isValidObject()method 
public function isValidObject(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in object is valid for this Set (well-typed, not already present in the set).

In the case that the object's type prevents it to be added as element for this set the method will throw a ClassCastException.

Parameters
o:Object

Returns
Booleantrue if the object is valid

Throws
ClassCastException — If the object's type prevents it to be added into this set
isValidType()method 
public function isValidType(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in object type match the current Set element's type.

In the case that the set is untyped the function will always returns true.

In the case that the object's type prevents it to be added as element for this set the method will throw a ClassCastException.

Parameters
o:ObjectObject to verify

Returns
Booleantrue if the object is elligible for this set object, either false.

Throws
ClassCastException — If the object's type prevents it to be added into this set
iterator()method 
public function iterator():Iterator

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns
Iterator — an iterator over the elements in this set.
lastIndexOf()method 
public function lastIndexOf(o:Object):int

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the index of the last occurrence of the specified object in this Set.

Parameters
o:Object — o the desired component.

Returns
int — the index of the first occurrence of the object argument in this stack, that is, the largest value k such that (elem === elementData[k]) is true; returns -1 if the object is not found.

Throws
ClassCastException — If the object's type prevents it to be added into this stack
listIterator()method 
public function listIterator(index:uint = 0):ListIterator

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to the next method. An initial call to the previous method would return the element with the specified index minus one.

This implementation returns a straightforward implementation of the ListIterator interface that extends the implementation of the Iterator interface returned by the iterator() method. The ListIterator implementation relies on the backing list's get(int), set(int, Object), add(int, Object) and remove(int) methods.

Parameters
index:uint (default = 0)uint index of the first element to be returned from the list iterator (by a call to the next method).

Returns
ListIterator — a list iterator of the elements in this list (in proper sequence), starting at the specified position in the list.

Throws
IndexOutOfBoundsException — index is out of range (index < 0 || index > size()).
matchType()method 
public function matchType(o:*):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Verify that the passed-in object type match the current set element's type.

Parameters
o:*

Returns
Booleantrue if the object is elligible for this set object, either false.
remove()method 
public function remove(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that o === e, if the set contains such an element. Returns true if the set contained the specified element (or equivalently, if the set changed as a result of the call). (The set will not contain the specified element once the call returns.)

Parameters
o:Objectobject to be removed from this Set, if present.

Returns
Booleantrue if the set contained the specified element.

Throws
ClassCastException — If the object's type prevents it to be added into this set

Example
Using the Set.remove() method of an untyped set :
   var set : Set = new Set();
   set.add ( "foo" );
   
   trace( set.size() ); // 1
   trace( set.remove( "foo" ) ); // true, the passed-in value have been removed
   
   trace( set.size() ); // 0
   trace( set.remove( "foo" ) ); // false, the passed-in value is no longer stored in this set
   
Using the Set.remove() method of a typed set :
   var set : Set = new Set( String );
   set.add ( "foo" );
   
   trace( set.size() ); // 1
   trace( set.remove( "foo" ) ); // true, the passed-in value have been removed
   
   // the code below will produce an exception
   try
   {
    set.remove( 45 ); // fail, as the passed-in value is not of type string
   }
   catch( e : ClassCastException )
   {
    trace ( e );  
   }
   

removeAll()method 
public function removeAll(c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified Collection is also a Set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.

The rules which govern collaboration between typed and untyped Collection are described in the isValidCollection descrition, all rules described there are supported by the removeAll method.

Parameters
c:CollectionCollection that defines which elements will be removed from this set.

Returns
Booleantrue if this set changed as a result of the call.

Throws
NullPointerException — if the specified collection is null.
 
IllegalArgumentException — If the passed-in collection type is not the same that the current one.

See also


Example
Using the Set.removeAll() with untyped sets
   var set1 : Set = new Set();
   var set2 : Set = new Set();
   
   set1.add( 1 );
   set1.add( 2 );
   set1.add( 3 );
   set1.add( 4 );
   set1.add( "foo1" );
   set1.add( "foo2" );
   set1.add( "foo3" );
   set1.add( "foo4" );
   
   set2.add( 1 );
   set2.add( 3 );
   set2.add( "foo1" );
   set2.add( "foo3" );
   
   trace ( set1.removeAll ( set2 ) ) ;// true
   // set1 now contains :
   // 2, 4, 'foo2', 'foo4' 
   

removeAt()method 
public function removeAt(o:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the element at the specified position in this set. Shifts any subsequent elements to the right (subtracts one from their indices).

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that o === e, if the set contains such an element. Returns true if the set contained the specified element (or equivalently, if the set changed as a result of the call). (The set will not contain the specified element once the call returns.)

Parameters
o:Objectobject to be removed from this Set, if present.

Returns
Booleantrue if the set contained the specified element.

Throws
IndexOutOfBoundsException — The passed-in index is not a valid index for this set

See also


Example
Using the Set.removeAt method with an untyped set
   var set : Set = new Set();
   set.add( "foo1" );
   set.add( "foo2" );
   set.add( "foo3" );
   
   trace ( set.removeAt( 2 ) ); // return true, 'foo3' have been removed
   trace ( set.removeAt( 0 ) ); // return true, 'foo1' have been removed  
           // and 'foo2' is now at index 0
   
   try
   {
    set.removeAt( 1 ); // fail, as set have only one entry at index 0
   }
   catch( e : IndexOutOfBoundsException )
   {
    trace( e );
   }
   

retainAll()method 
public function retainAll(c:Collection):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a Set, this operation effectively modifies this set so that its value is the intersection of the two sets.

The rules which govern collaboration between typed and untyped Collection are described in the isValidCollection descrition, all rules described there are supported by the retainAll method.

Parameters
c:CollectionCollection that defines which elements this set will retain.

Returns
Booleantrue if this collection changed as a result of the call.

Throws
NullPointerException — if the specified collection is null.
 
IllegalArgumentException — If the passed-in collection type is not the same that the current one.

See also


Example
Using the Set.retainAll() with untyped sets
   var set1 : Set = new Set();
   var set2 : Set = new Set();
   
   set1.add( 1 );
   set1.add( 2 );
   set1.add( 3 );
   set1.add( 4 );
   set1.add( "foo1" );
   set1.add( "foo2" );
   set1.add( "foo3" );
   set1.add( "foo4" );
   
   set2.add( 1 );
   set2.add( 3 );
   set2.add( "foo1" );
   set2.add( "foo3" );
   
   trace ( set1.retainAll ( set2 ) ) ;// true
   // set1 now contains :
   // 1, 3, 'foo1', 'foo3' 
   

set()method 
public function set(index:uint, o:Object):Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Insert the passed-in Object in this set at the specified index. The method returns the object previously stored at this index.

If the passed-in index is not a valid index for this set, the function throw an IndexOutOfBoundsException exception.

If the passed-in object's type prevents it to be added in this set the function will throw a ClassCastException.

Parameters
index:uintuint index at which insert the passed-in Object.
 
o:ObjectObject to insert in this set

Returns
ObjectObject previously stored at the specified index or null if the insertion haven't been done.

Throws
IndexOutOfBoundsException — The passed-in index is not a valid index for this set
 
ClassCastException — If the object's type prevents it to be added into this set
size()method 
public function size():uint

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the number of elements in this set (its cardinality).

Returns
uintNumber of elements in this set (its cardinality).
subList()method 
public function subList(fromIndex:uint, toIndex:uint):List

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and ToIndex are equal, the returned List is empty.)

Parameters
fromIndex:uint — fromIndex low endpoint (inclusive) of the subList.
 
toIndex:uint — high endpoint (exclusive) of the subList.

Returns
List — a view of the specified range within this List.

Throws
IndexOutOfBoundsException — fromIndex or toIndex are out of range (index < 0 || index > size()).
swap()method 
public function swap(index1:uint, index2:uint):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Swap two objects stored in the passed-in index

If the passed-in index are not valid index for this set, the function throw an IndexOutOfBoundsException exception.

Parameters
index1:uintuint index of the first Object.
 
index2:uintuint index of the second Object.

Throws
— — The passed-in index are not valid index for this set
toArray()method 
public function toArray():Array

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns an array containing all the elements in this set. Obeys the general contract of the Collection.toArray method.

Returns
ArrayArray containing all of the elements in this set.

See also

toString()method 
public function toString():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the String representation of this object.

The function return a string like com.bourre.collection::Set<String> for a typed collection. The string between the < and > is the name of the type of the collection's elements. If the collection is an untyped collection the function will simply return the result of the PixlibStringifier.stringify call.

Returns
StringString representation of this object.