Package | com.yworks.support |
Class | public class HashSet |
Inheritance | HashSet Object |
Implements | Collection |
Collection
that obeys the 'set' semantics.
An item can only be contained once in the same set. This implementation is based on hash values and equality checks.
Method | Defined By | ||
---|---|---|---|
Creates a new hashset using the given values to initialize the set,
or an empty hashset if no values are passed. | HashSet | ||
Adds a collection of elements to this set. | HashSet | ||
addItem(item:Object):Boolean
Adds the given item to this set. | HashSet | ||
clear():void
Removes all of the elements from this collection. | HashSet | ||
contains(item:Object):Boolean
Returns true if this collection contains the specified element. | HashSet | ||
getItemAt(index:int):Object
Not supported. | HashSet | ||
isEmpty():Boolean
Returns true if this collection contains no elements. | HashSet | ||
Returns an iterator over a set of elements. | HashSet | ||
length():uint
Returns the number of elements in this collection. | HashSet | ||
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation). | HashSet | ||
toArray():Array
Returns an array containing all of the elements in this collection. | HashSet |
HashSet | () | Constructor |
public function HashSet(values:Iterable = null)
Creates a new hashset using the given values to initialize the set, or an empty hashset if no values are passed.
Parametersvalues:Iterable (default = null )
|
addAll | () | method |
public function addAll(iter:Iterable):void
Adds a collection of elements to this set.
Parameters
iter:Iterable |
addItem | () | method |
public function addItem(item:Object):Boolean
Adds the given item to this set.
If the item is already contained in this set, it will not be added.
Parameters
item:Object — The item to add.
|
Boolean |
clear | () | method |
public function clear():void
Removes all of the elements from this collection. The collection will be empty after this method returns.
contains | () | method |
public function contains(item:Object):Boolean
Returns true if this collection contains the specified element.
Parameters
item:Object — element whose presence in this collection is to be tested
|
Boolean — true if this collection contains the specified element
|
getItemAt | () | method |
public function getItemAt(index:int):Object
Not supported.
Parameters
index:int |
Object |
isEmpty | () | method |
public function isEmpty():Boolean
Returns true if this collection contains no elements.
ReturnsBoolean — true if this collection contains no elements
|
iterator | () | method |
public function iterator():Iterator
Returns an iterator over a set of elements.
ReturnsIterator — an Iterator.
|
length | () | method |
public function length():uint
Returns the number of elements in this collection.
Returnsuint — the number of elements in this collection
|
removeItem | () | method |
public function removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
Parameters
item:Object — element to be removed from this collection, if present
|
Boolean — true if an element was removed as a result of this call
|
toArray | () | method |
public function toArray():Array
Returns an array containing all of the elements in this collection.
ReturnsArray — an array containing all of the elements in this collection
|