Legal Notice, Privacy Policy

Impressum, Datenschutzerklärung

Cerberus X Documentation

Class Set<T>

A set is a container style object that provides a mechanism for keeping track of a number of objects. More...

Declarations

Extended By
FloatSet , IntSet , StringSet
Please note that only documented classes are listed here, there might be undocumented classes that extend this one.
Constructors
New ( map:Map<T,Object> ) Extending classes should invoke this method with a valid map object to be used to implement the set.
Methods
Clear : Int () Removes all items from the set.
Contains : Bool ( value:T ) Return True if the specified value is contained in the set, else False.
Count : Int () Counts and returns the number of objects in the set.
Insert : Int ( value:T ) Inserts value into the set.
IsEmpty : Bool () Returns True if the set is empty, ie: contains no items, else False.
ObjectEnumerator : Object () Returns an enumerator object that allows sets to be used with For Eachin loops.
Remove : Int ( value:T ) Removes value from the set.

Detailed Discussion

A set is a container style object that provides a mechanism for keeping track of a number of objects.

Each object in a set occurs exactly once - inserting the same object into a set multiple times does not result in the set containing multiple references to the same object.

Sets are implemented behind the scenes using Map objects, and are just as efficient at insertng, removing and finding objects.

Classes that extend Set must invoke Super.New with an instance of a map object.


Constructors Documentation

Method New ( map:Map<T,Object> )

Extending classes should invoke this method with a valid map object to be used to implement the set.


Methods Documentation

Method Clear : Int ()

Removes all items from the set.

Method Contains : Bool ( value:T )

Return True if the specified value is contained in the set, else False.

Parameters

value - value to check

Method Count : Int ()

Counts and returns the number of objects in the set.

Note that this method takes O(N) time - that is, it must visit each object in the set.

Method Insert : Int ( value:T )

Inserts value into the set.

Parameters

value - value to insert.

Method IsEmpty : Bool ()

Returns True if the set is empty, ie: contains no items, else False.

Method ObjectEnumerator : Object ()

Returns an enumerator object that allows sets to be used with For Eachin loops.

Method Remove : Int ( value:T )

Removes value from the set.

Parameters

value - value to remove.