Packageas3.collections
Classpublic class SortedSet
InheritanceSortedSet Inheritance Treap
ImplementsISortedSet

Set, whose items are kept in a sorted order defined by a comparator.

The SortedSet is actually only a public name of the Treap from that it inherits the entire implementation.

Trying to add an item that is not comparable due to a type mismatch will throw another execption. See the Treap documentation.

Runtime of operations

See also

as3.collections.core.Treap


Public Properties
 PropertyDefined by
 InheritednumItems : uint
Returns the size of the collection.
Treap
Protected Properties
 PropertyDefined by
 Inherited_comparator : IComparator
The sort criterion.
Treap
 Inherited_numItems : uint = 0
The size of the tree.
Treap
 Inherited_root : TreapNode
The root node.
Treap
Public Methods
 MethodDefined by
  
SortedSet(comparator:IComparator)
Creates a new SortedSet.
SortedSet
 Inherited
addItem(item:*):Boolean
Adds an item to the tree.
Treap
 Inherited
clear():void
Removes all items from the collection.
Treap
 Inherited
getEqualItem(item:*):*
Returns the item, that is equal to the given item against the sort criterion.
Treap
 Inherited
Returns the lowest item of the sorted set.
Treap
 Inherited
getIterator(cursor:uint = 0):IIterator
Returns an iterator over the tree.
Treap
 Inherited
Returns the greatest item of the sorted set.
Treap
 Inherited
hasEqualItem(item:*):Boolean
Returns true, if the set contains at least one item that is equal to the given item against the sort criterion.
Treap
 Inherited
hasItem(item:*):Boolean
Tests, if an item is contained by the set.
Treap
 Inherited
Removes the lowest item of the sorted set.
Treap
 Inherited
removeItem(item:*):Boolean
Removes an item from the set.
Treap
 Inherited
Removes the greatest item of the sorted set.
Treap
 Inherited
toArray():Array
Returns an array of all items in the order of the particular collection.
Treap
  
toString():String
Info
SortedSet
Protected Methods
 MethodDefined by
 Inherited
addItemToTree(item:*):Boolean
Adds an item to the tree.
Treap
 Inherited
nodeAdded(node:TreapNode):void
Template method to notify subclasses after a new node has been added.
Treap
 Inherited
nodeRemoved():void
Commits the removal of the node, announced in willRemoveNode()
Treap
 Inherited
Removes a node from the tree.
Treap
 Inherited
rotate(parent:TreapNode, child:TreapNode):void
Rotates a parent with its child node.
Treap
 Inherited
Template method to notify subclasses when a node is about to be removed.
Treap
Constructor detail
SortedSet()constructor
public function SortedSet(comparator:IComparator)

Creates a new SortedSet.

Parameters
comparator:IComparator — The sort criterion.
Method detail
toString()method
public override function toString():String

Info

Returns
String