Packagecom.addicted2flash.util
Classpublic class SortedArraySet
InheritanceSortedArraySet Inheritance ArraySet Inheritance AbstractArraySet Inheritance AbstractArrayCollection
ImplementsISortedSet

Implementation of an ordered Array-based set. A collection that contains no duplicate elements and at most one null element.



Public Properties
 PropertyDefined by
 Inheritedlist : Array
return the internal list.
AbstractArrayCollection
Protected Properties
 PropertyDefined by
 Inherited_list : Array
AbstractArrayCollection
Public Methods
 MethodDefined by
  
SortedArraySet(cmp:IComparator, field:Array = null)
Create a new SortedArraySet
SortedArraySet
  
add(o:*):void
Appends the specified element to the end of this list (optional operation).
SortedArraySet
 Inherited
Adds all of the elements in the specified collection to this collection (optional operation).
AbstractArrayCollection
 Inherited
clear():void
Removes all of the elements from this list (optional operation).
AbstractArrayCollection
  
Returns a copy of the ICollection.
SortedArraySet
  
Returns the comparator used to order the elements in this set.
SortedArraySet
 Inherited
contains(o:*):Boolean
Returns true if this list contains the specified element.
AbstractArrayCollection
 Inherited
Returns true if this collection contains all of the elements in the specified collection.
AbstractArrayCollection
  
dispose():void
free memory for garbage collection.
SortedArraySet
  
first():*
Returns the first (lowest) element currently in this set.
SortedArraySet
 Inherited
getAt(i:int):*
Returns the element at the specified position in this collection.
AbstractArrayCollection
  
headSortedSet(toElement:*):ISortedSet
Returns a view of the portion of this set whose elements are strictly less than toElement.
SortedArraySet
 Inherited
isEmpty():Boolean
Returns true if this list contains no elements.
AbstractArrayCollection
 Inherited
Returns an iterator over the elements in this list.
AbstractArrayCollection
  
last():*
Returns the last (highest) element currently in this set.
SortedArraySet
 Inherited
remove(o:*):Boolean
Removes the first occurrence in this list of the specified element (optional operation).
AbstractArrayCollection
 Inherited
Removes a single instance of the specified element from this collection, if it is present (optional operation)
AbstractArrayCollection
 Inherited
size():int
Returns the number of elements in this list.
AbstractArrayCollection
  
subSortedSet(fromElement:*, toElement:*):ISortedSet
Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.
SortedArraySet
  
tailSortedSet(fromElement:*):ISortedSet
Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
SortedArraySet
 Inherited
toArray():Array
Converts the collection into an array.
AbstractArrayCollection
  
toString():String
String representation of SortedArraySet.
SortedArraySet
Constructor detail
SortedArraySet()constructor
public function SortedArraySet(cmp:IComparator, field:Array = null)

Create a new SortedArraySet

Parameters
cmp:IComparatorIComparator for ordering elements
 
field:Array (default = null) — (optional) an existing Array ( will be ordered immediately after instantiation )
Method detail
add()method
public override function add(o:*):void

Appends the specified element to the end of this list (optional operation).

Parameters
o:*
clone()method 
public override function clone():ICollection

Returns a copy of the ICollection.

Returns
ICollection — a copy of the ICollection
comparator()method 
public function comparator():IComparator

Returns the comparator used to order the elements in this set.

Returns
IComparator — the comparator used to order the elements in this set.
dispose()method 
public override function dispose():void

free memory for garbage collection.

first()method 
public function first():*

Returns the first (lowest) element currently in this set.

Returns
* — the first (lowest) element currently in this set (or null if set is empty)
headSortedSet()method 
public function headSortedSet(toElement:*):ISortedSet

Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

Parameters
toElement:* — high endpoint (exclusive) of the returned set

Returns
ISortedSet — a view of the portion of this set whose elements are strictly less than toElement (return empty sorted set, if toElement doesn't exist)
last()method 
public function last():*

Returns the last (highest) element currently in this set.

Returns
* — the last (highest) element currently in this set (or null if set is empty)
subSortedSet()method 
public function subSortedSet(fromElement:*, toElement:*):ISortedSet

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

Parameters
fromElement:* — low endpoint (inclusive) of the returned set
 
toElement:* — high endpoint (exclusive) of the returned set

Returns
ISortedSet — a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive
tailSortedSet()method 
public function tailSortedSet(fromElement:*):ISortedSet

Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

Parameters
fromElement:* — low endpoint (inclusive) of the returned set

Returns
ISortedSet — a view of the portion of this set whose elements are greater than or equal to fromElement
toString()method 
public override function toString():String

String representation of SortedArraySet.

Returns
String — String representation of SortedArraySet