Package | com.yworks.bridge.util |
Class | public class TreeSet |
Inheritance | TreeSet AbstractSet AbstractCollection YObject Object |
Implements | SortedSet, Clonable |
Property | Defined By | ||
---|---|---|---|
empty : Boolean [override] [read-only]
Answers if this TreeSet has no elements, a size of zero. | TreeSet | ||
length : int [override] [read-only]
Answers the number of elements in this TreeSet. | TreeSet |
Method | Defined By | ||
---|---|---|---|
TreeSet(init:Boolean = true)
Constructs a new empty instance of TreeSet which uses natural ordering. | TreeSet | ||
addAll(collection:Collection):Boolean [override]
Adds the objects in the specified Collection to this TreeSet. | TreeSet | ||
addItem(object:Object):Boolean [override]
Adds the specified object to this TreeSet. | TreeSet | ||
clear():void [override]
Removes all elements from this TreeSet, leaving it empty. | TreeSet | ||
clone():Object [override]
Answers a new TreeSet with the same elements, size and comparator as this TreeSet. | TreeSet | ||
Answers the Comparator used to compare elements in this TreeSet. | TreeSet | ||
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection. | AbstractCollection | ||
containsItem(object:Object):Boolean [override]
Searches this TreeSet for the specified object. | TreeSet | ||
equals(object:Object):Boolean [override]
Compares the specified object to this Set and answer if they are equal. | AbstractSet | ||
first():Object
Answers the first element in this TreeSet. | TreeSet | ||
getClass():Class [override] | TreeSet | ||
hashCode():int [override]
Answers an integer hash code for the receiver. | AbstractSet | ||
Answers a SortedSet of the specified portion of this TreeSet which contains elements less than the end element. | TreeSet | ||
[override]
Answers an Iterator on the elements of this TreeSet. | TreeSet | ||
last():Object
Answers the last element in this TreeSet. | TreeSet | ||
[static]
Constructs a new empty instance of TreeSet which uses natural ordering. | TreeSet | ||
[static]
Constructs a new instance of TreeSet which uses natural ordering and containing the unique elements in the specified collection. | TreeSet | ||
[static]
Constructs a new empty instance of TreeSet which uses the specified Comparator. | TreeSet | ||
[static]
Constructs a new instance of TreeSet containing the elements in the specified SortedSet and using the same Comparator. | TreeSet | ||
removeAll(collection:Collection):Boolean [override]
Removes all occurrences in this Collection of each object in the specified Collection. | AbstractSet | ||
removeItem(object:Object):Boolean [override]
Removes an occurrence of the specified object from this TreeSet. | TreeSet | ||
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not contained in the specified Collection. | AbstractCollection | ||
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element but less than the end element. | TreeSet | ||
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element. | TreeSet | ||
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection. | AbstractCollection | ||
toArray2(contents:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection. | AbstractCollection | ||
toString():String
Answers the string representation of this Collection. | AbstractCollection |
Method | Defined By | ||
---|---|---|---|
cloneImpl(o:Object):void [override] | TreeSet | ||
initAbstractCollection():void | AbstractCollection | ||
initAbstractSet():void | AbstractSet | ||
initTreeSet1():void
Initializes this object. | TreeSet | ||
initTreeSet2(collection:Collection):void
Initializes this object. | TreeSet | ||
initTreeSet3(comparator:Comparator):void
Initializes this object. | TreeSet | ||
initTreeSet4(_set:SortedSet):void
Initializes this object. | TreeSet |
empty | property |
empty:Boolean
[read-only] [override] Answers if this TreeSet has no elements, a size of zero.
public function get empty():Boolean
See also
length | property |
length:int
[read-only] [override] Answers the number of elements in this TreeSet.
public function get length():int
TreeSet | () | Constructor |
public function TreeSet(init:Boolean = true)
Constructs a new empty instance of TreeSet which uses natural ordering.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
addAll | () | method |
override public function addAll(collection:Collection):Boolean
Adds the objects in the specified Collection to this TreeSet.
Parameters
collection:Collection — the Collection of objects
|
Boolean — true if this TreeSet is modified, false otherwise
|
TypeError — when an object in the Collection cannot be compared with the elements in this TreeSet
| |
ReferenceError — when an object in the Collection is null and the comparator cannot handle null
|
addItem | () | method |
override public function addItem(object:Object):Boolean
Adds the specified object to this TreeSet.
Parameters
object:Object — the object to add
|
Boolean — true when this TreeSet did not already contain the object, false otherwise
|
TypeError — when the object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the object is null and the comparator cannot handle null
|
clear | () | method |
override public function clear():void
Removes all elements from this TreeSet, leaving it empty.
See also
clone | () | method |
override public function clone():Object
Answers a new TreeSet with the same elements, size and comparator as this TreeSet.
ReturnsObject — a shallow copy of this TreeSet
|
See also
cloneImpl | () | method |
override protected function cloneImpl(o:Object):void
Parameters
o:Object |
comparator | () | method |
public function comparator():Comparator
Answers the Comparator used to compare elements in this TreeSet.
ReturnsComparator — a Comparator or null if the natural ordering is used
|
containsItem | () | method |
override public function containsItem(object:Object):Boolean
Searches this TreeSet for the specified object.
Parameters
object:Object — the object to search for
|
Boolean — true if object is an element of this TreeSet, false otherwise
|
TypeError — when the object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the object is null and the comparator cannot handle null
|
first | () | method |
public function first():Object
Answers the first element in this TreeSet.
ReturnsObject — the first element
|
Error — when this TreeSet is empty
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
headSet | () | method |
public function headSet(end:Object):SortedSet
Answers a SortedSet of the specified portion of this TreeSet which contains elements less than the end element. The returned SortedSet is backed by this TreeSet so changes to one are reflected by the other.
Parameters
end:Object — the end element
|
SortedSet — a subset where the elements are less than end
|
TypeError — when the end object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the end object is null and the comparator cannot handle null
|
initTreeSet1 | () | method |
protected final function initTreeSet1():void
Initializes this object. See the documentation of the corresponding factory method newTreeSet1()
for details.
See also
initTreeSet2 | () | method |
protected final function initTreeSet2(collection:Collection):void
Initializes this object. See the documentation of the corresponding factory method newTreeSet2()
for details.
Parameters
collection:Collection |
See also
initTreeSet3 | () | method |
protected final function initTreeSet3(comparator:Comparator):void
Initializes this object. See the documentation of the corresponding factory method newTreeSet3()
for details.
Parameters
comparator:Comparator |
See also
initTreeSet4 | () | method |
protected final function initTreeSet4(_set:SortedSet):void
Initializes this object. See the documentation of the corresponding factory method newTreeSet4()
for details.
Parameters
_set:SortedSet |
See also
iterator | () | method |
override public function iterator():Iterator
Answers an Iterator on the elements of this TreeSet.
ReturnsIterator — an Iterator on the elements of this TreeSet
|
See also
last | () | method |
public function last():Object
Answers the last element in this TreeSet.
ReturnsObject — the last element
|
Error — when this TreeSet is empty
|
newTreeSet1 | () | method |
public static function newTreeSet1():TreeSet
Constructs a new empty instance of TreeSet which uses natural ordering.
ReturnsTreeSet |
newTreeSet2 | () | method |
public static function newTreeSet2(collection:Collection):TreeSet
Constructs a new instance of TreeSet which uses natural ordering and containing the unique elements in the specified collection.
Parameters
collection:Collection — the collection of elements to add
|
TreeSet |
TypeError — when an element in the Collection does not implement the Comparable interface, or the elements in the Collection cannot be compared
|
newTreeSet3 | () | method |
public static function newTreeSet3(comparator:Comparator):TreeSet
Constructs a new empty instance of TreeSet which uses the specified Comparator.
Parameters
comparator:Comparator — the Comparator
|
TreeSet |
newTreeSet4 | () | method |
public static function newTreeSet4(_set:SortedSet):TreeSet
Constructs a new instance of TreeSet containing the elements in the specified SortedSet and using the same Comparator.
Parameters
_set:SortedSet — the SortedSet of elements to add
|
TreeSet |
removeItem | () | method |
override public function removeItem(object:Object):Boolean
Removes an occurrence of the specified object from this TreeSet.
Parameters
object:Object — the object to remove
|
Boolean — true if this TreeSet is modified, false otherwise
|
TypeError — when the object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the object is null and the comparator cannot handle null
|
subSet | () | method |
public function subSet(start:Object, end:Object):SortedSet
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element but less than the end element. The returned SortedSet is backed by this TreeSet so changes to one are reflected by the other.
Parameters
start:Object — the start element
| |
end:Object — the end element
|
SortedSet — a subset where the elements are greater or equal to start and less than end
|
TypeError — when the start or end object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the start or end object is null and the comparator cannot handle null
|
tailSet | () | method |
public function tailSet(start:Object):SortedSet
Answers a SortedSet of the specified portion of this TreeSet which contains elements greater or equal to the start element. The returned SortedSet is backed by this TreeSet so changes to one are reflected by the other.
Parameters
start:Object — the start element
|
SortedSet — a subset where the elements are greater or equal to start
|
TypeError — when the start object cannot be compared with the elements in this TreeSet
| |
ReferenceError — when the start object is null and the comparator cannot handle null
|