Packagecom.yworks.bridge.util
Interfacepublic interface SortedSet extends Set, Collection
Implementors TreeSet

SortedSet is a Set which iterates its elements in sorted order.



Public Properties
 PropertyDefined By
 Inheritedempty : Boolean
[read-only] Answers if this Collection has no elements, a size of zero.
Collection
 Inheritedlength : int
[read-only] Returns a count of how many objects are contained by this collection.
Collection
Public Methods
 MethodDefined By
 Inherited
addAll(collection:Collection):Boolean
Attempts to add all of the objects contained in collection to the contents of this collection.
Collection
 Inherited
addItem(object:Object):Boolean
Attempts to add object to the contents of this Collection.
Collection
 Inherited
clear():void
Removes all elements from this Collection, leaving it empty.
Collection
  
Answers the Comparator used to compare elements in this SortedSet.
SortedSet
 Inherited
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection.
Collection
 Inherited
containsItem(object:Object):Boolean
Searches this Collection for the specified object.
Collection
  
first():Object
Answer the first sorted element in this SortedSet.
SortedSet
  
headSet(end:Object):SortedSet
Answers a SortedSet of the specified portion of this SortedSet which contains elements less than the end element.
SortedSet
 Inherited
Returns an instance of com.yworks.bridge.util.Iterator that may be used to access the objects contained by this collection.
Collection
  
last():Object
Answer the last sorted element in this SortedSet.
SortedSet
 Inherited
removeAll(collection:Collection):Boolean
Removes all occurrences in this Collection of each object in the specified Collection.
Collection
 Inherited
removeItem(object:Object):Boolean
Removes the first occurrence of the specified object from this Collection.
Collection
 Inherited
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not also found in the contents of collection.
Collection
  
subSet(start:Object, end:Object):SortedSet
Answers a SortedSet of the specified portion of this SortedSet which contains elements greater or equal to the start element but less than the end element.
SortedSet
  
tailSet(start:Object):SortedSet
Answers a SortedSet of the specified portion of this SortedSet which contains elements greater or equal to the start element.
SortedSet
 Inherited
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection.
Collection
 Inherited
toArray2(array:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection.
Collection
Method Detail
comparator()method
public function comparator():Comparator

Answers the Comparator used to compare elements in this SortedSet.

Returns
Comparator — a Comparator or null if the natural order is used
first()method 
public function first():Object

Answer the first sorted element in this SortedSet.

Returns
Object — the first sorted element

Throws
Error — when this SortedSet is empty
headSet()method 
public function headSet(end:Object):SortedSet

Answers a SortedSet of the specified portion of this SortedSet which contains elements less than the end element. The returned SortedSet is backed by this SortedSet so changes to one are reflected by the other.

Parameters

end:Object — the end element

Returns
SortedSet — a subset where the elements are less than end

Throws
TypeError — when the class of the end element is inappropriate for this SubSet
 
ReferenceError — when the end element is null and this SortedSet does not support null elements
last()method 
public function last():Object

Answer the last sorted element in this SortedSet.

Returns
Object — the last sorted element

Throws
Error — when this SortedSet is empty
subSet()method 
public function subSet(start:Object, end:Object):SortedSet

Answers a SortedSet of the specified portion of this SortedSet which contains elements greater or equal to the start element but less than the end element. The returned SortedSet is backed by this SortedMap so changes to one are reflected by the other.

Parameters

start:Object — the start element
 
end:Object — the end element

Returns
SortedSet — a subset where the elements are greater or equal to start and less than end

Throws
TypeError — when the class of the start or end element is inappropriate for this SubSet
 
ReferenceError — when the start or end element is null and this SortedSet does not support null elements
 
IllegalArgumentException — when the start element is greater than the end element
tailSet()method 
public function tailSet(start:Object):SortedSet

Answers a SortedSet of the specified portion of this SortedSet which contains elements greater or equal to the start element. The returned SortedSet is backed by this SortedSet so changes to one are reflected by the other.

Parameters

start:Object — the start element

Returns
SortedSet — a subset where the elements are greater or equal to start

Throws
TypeError — when the class of the start element is inappropriate for this SubSet
 
ReferenceError — when the start element is null and this SortedSet does not support null elements