Packagecom.threerings.util
Interfacepublic interface Set
ImplementorsMapSet

A Set contains unique instances of objects.

See also

com.threerings.util.Sets


Public Methods
 MethodDefined by
  
add(o:Object):Boolean
Adds the specified element to the set if it's not already present.
Set
  
clear():void
Remove all elements from this set.
Set
  
contains(o:Object):Boolean
Returns true if this set contains the specified element.
Set
  
forEach(fn:Function):void
Call the specified function, which accepts an element as an argument.
Set
  
isEmpty():Boolean
Returns true if this set contains no elements.
Set
  
remove(o:Object):Boolean
Removes the specified element from this set if it is present.
Set
  
size():int
Retuns the number of elements in this set.
Set
  
toArray():Array
Returns all elements in the set in an Array.
Set
Method detail
add()method
public function add(o:Object):Boolean

Adds the specified element to the set if it's not already present. Returns true if the set did not already contain the specified element.

Parameters
o:Object

Returns
Boolean
clear()method 
public function clear():void

Remove all elements from this set.

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

Returns true if this set contains the specified element.

Parameters
o:Object

Returns
Boolean
forEach()method 
public function forEach(fn:Function):void

Call the specified function, which accepts an element as an argument. Signature: function (o :Object) :void or function (o :Object) :Boolean If you return a Boolean, you may return true to indicate that you've found what you were looking for, and halt iteration.

Parameters
fn:Function
isEmpty()method 
public function isEmpty():Boolean

Returns true if this set contains no elements.

Returns
Boolean
remove()method 
public function remove(o:Object):Boolean

Removes the specified element from this set if it is present. Returns true if the set contained the specified element.

Parameters
o:Object

Returns
Boolean
size()method 
public function size():int

Retuns the number of elements in this set.

Returns
int
toArray()method 
public function toArray():Array

Returns all elements in the set in an Array. The Array is not a 'view': it can be modified without disturbing the Map from whence it came.

Returns
Array