| Package | system.data.sets |
| Class | public class TypedSet |
| Inheritance | TypedSet TypedCollection Object |
| Implements | Set |
Example :
import system.data.sets.ArraySet ;
import system.data.sets.TypedSet ;
var co:ArraySet = new ArraySet(["item1", "item2"]) ;
var ts:TypedSet = new TypedSet( String , co ) ;
ts.add( "item3" ) ;
trace( ts ) ; // {item1,item2,item3}
try
{
ts.add( 10 ) ;
}
catch( e:Error )
{
trace( e.message ) ; // TypedSet.validate(10) is mismatch.
}
| Method | Defined By | ||
|---|---|---|---|
Creates a new TypedSet instance. | TypedSet | ||
![]() | add(o:*):Boolean
Inserts an element in the collection. | TypedCollection | |
![]() | clear():void
Removes all elements in the collection. | TypedCollection | |
clone():* [override]
Returns a shallow copy of this collection. | TypedSet | ||
![]() | contains(o:*):Boolean
Returns true if this collection contains the specified element. | TypedCollection | |
![]() | get(key:*):*
Returns the element from this collection at the passed key index. | TypedCollection | |
![]() | indexOf(o:*, fromIndex:uint = 0):int
Returns the index of an element in the collection. | TypedCollection | |
![]() | isEmpty():Boolean
Returns true if this collection contains no elements. | TypedCollection | |
![]() |
Returns an iterator over the elements in this collection. | TypedCollection | |
![]() | remove(o:*):*
Removes a single instance of the specified element from this collection, if it is present (optional operation). | TypedCollection | |
![]() | size():uint
Returns the number of elements in this collection. | TypedCollection | |
![]() | supports(value:*):Boolean
Returns true if the specific value is valid. | TypedCollection | |
![]() | toArray():Array
Returns an array containing all of the elements in this collection. | TypedCollection | |
![]() | toSource(indent:int = 0):String
Returns the source code string representation of the object. | TypedCollection | |
![]() | toString():String
Returns the String representation of the object. | TypedCollection | |
![]() | validate(value:*):void
Evaluates the specified value and throw a TypeError object if the value is not valid. | TypedCollection | |
| TypedSet | () | Constructor |
public function TypedSet(type:*, s:Set)Creates a new TypedSet instance.
Parameterstype:* — the type of this Typeable object (a Class or a Function).
| |
s:Set — The Collection reference of this wrapper.
|
ArgumentError — if the type is null or undefined.
| |
TypeError — if a value in the passed-in Collection object isn't valid.
|
| clone | () | method |
override public function clone():*Returns a shallow copy of this collection.
Returns* — a shallow copy of this collection.
|