| Package | de.polygonal.ds |
| Class | public class Set |
| Inheritance | Set Object |
| Implements | Collection |
| Property | Defined By | ||
|---|---|---|---|
| size : int [read-only]
The total number of items. | Set | ||
| Method | Defined By | ||
|---|---|---|---|
Set()
Creates a new empty set. | Set | ||
clear():void
Clears all items. | Set | ||
contains(obj:*):Boolean
Determines if the collection contains a given item. | Set | ||
dump():String
Prints out all elements (for debug/demo purposes). | Set | ||
get(obj:*):*
Reads an item from the set. | Set | ||
Initializes an iterator object pointing to the first item in the
collection. | Set | ||
isEmpty():Boolean
Checks if the collection is empty. | Set | ||
remove(obj:*):Boolean
Removes an item from the set. | Set | ||
set(obj:*):void
Writes an item to the set. | Set | ||
toArray():Array
Converts the collection into an array. | Set | ||
toString():String
Prints out a string representing the current object. | Set | ||
| size | property |
size:int [read-only] The total number of items.
public function get size():int| Set | () | Constructor |
public function Set()Creates a new empty set.
| clear | () | method |
public function clear():voidClears all items.
| contains | () | method |
public function contains(obj:*):BooleanDetermines if the collection contains a given item.
Parameters
obj:* — The item to search for.
|
Boolean — True if the item exists, otherwise false.
|
| dump | () | method |
public function dump():StringPrints out all elements (for debug/demo purposes).
ReturnsString — A human-readable representation of the structure.
|
| get | () | method |
public function get(obj:*):*Reads an item from the set.
Parameters
obj:* — The item to retrieve.
|
* — The item matching the obj parameter or null if the item is
not part of the set.
|
| getIterator | () | method |
public function getIterator():IteratorInitializes an iterator object pointing to the first item in the collection.
ReturnsIterator — An iterator object.
|
| isEmpty | () | method |
public function isEmpty():BooleanChecks if the collection is empty.
ReturnsBoolean — True if empty, otherwise false.
|
| remove | () | method |
public function remove(obj:*):BooleanRemoves an item from the set.
Parameters
obj:* — The item to remove
|
Boolean — The removed item or null if the item wasn't contained
by the set.
|
| set | () | method |
public function set(obj:*):voidWrites an item to the set.
Parameters
obj:* — The item to be added to the set.
|
| toArray | () | method |
public function toArray():ArrayConverts the collection into an array.
ReturnsArray — An array.
|
| toString | () | method |
public function toString():StringPrints out a string representing the current object.
ReturnsString — A string representing the current object.
|