Package | com.yworks.bridge.util |
Class | public class TreeMap |
Inheritance | TreeMap AbstractMap YObject Object |
Implements | SortedMap, Clonable |
Method | Defined By | ||
---|---|---|---|
TreeMap(init:Boolean = true)
Constructs a new empty instance of spec.TreeMap. | TreeMap | ||
clear():void [override]
Removes all mappings from this spec.TreeMap, leaving it empty. | TreeMap | ||
clone():Object [override]
Answers a new spec.TreeMap with the same mappings, size and comparator as this spec.TreeMap. | TreeMap | ||
Answers the Comparator used to compare elements in this spec.TreeMap. | TreeMap | ||
containsKey(key:Object):Boolean [override]
Searches this spec.TreeMap for the specified key. | TreeMap | ||
containsValue(value:Object):Boolean [override]
Searches this spec.TreeMap for the specified value. | TreeMap | ||
[override]
Answers a Set of the mappings contained in this spec.TreeMap. | TreeMap | ||
equals(object:Object):Boolean [override]
Compares the specified object to this Map and answer if they are equal. | AbstractMap | ||
firstKey():Object
Answers the first sorted key in this spec.TreeMap. | TreeMap | ||
getClass():Class [override] | TreeMap | ||
getValue(key:Object):Object [override]
Answers the value of the mapping with the specified key. | TreeMap | ||
hashCode():int [override]
Answers an integer hash code for the receiver. | AbstractMap | ||
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys less than the end key. | TreeMap | ||
[override]
Answers a Set of the keys contained in this spec.TreeMap. | TreeMap | ||
lastKey():Object
Answer the last sorted key in this spec.TreeMap. | TreeMap | ||
[static]
Constructs a new empty instance of spec.TreeMap. | TreeMap | ||
[static]
Constructs a new empty instance of spec.TreeMap which uses the specified Comparator. | TreeMap | ||
[static]
Constructs a new instance of spec.TreeMap containing the mappings from the specified Map and using the natural ordering. | TreeMap | ||
[static]
Constructs a new instance of spec.TreeMap containing the mappings from the specified SortedMap and using the same Comparator. | TreeMap | ||
[override]
Copies every mapping in the specified Map to this spec.TreeMap. | TreeMap | ||
putValue(key:Object, value:Object):Object [override]
Maps the specified key to the specified value. | TreeMap | ||
remove(key:Object):Object [override]
Removes a mapping with the specified key from this spec.TreeMap. | TreeMap | ||
size():int [override]
Answers the number of mappings in this spec.TreeMap. | TreeMap | ||
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys greater or equal to the start key but less than the end key. | TreeMap | ||
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys greater or equal to the start key. | TreeMap | ||
toString():String
Answers the string representation of this Map. | AbstractMap | ||
[override]
Answers a Collection of the values contained in this spec.TreeMap. | TreeMap |
Method | Defined By | ||
---|---|---|---|
cloneImpl(o:Object):void [override] | TreeMap | ||
initAbstractMap():void | AbstractMap | ||
initTreeMap1():void
Initializes this object. | TreeMap | ||
initTreeMap2(comparator:Comparator):void
Initializes this object. | TreeMap | ||
initTreeMap3(map:Map):void
Initializes this object. | TreeMap | ||
initTreeMap4(map:SortedMap):void
Initializes this object. | TreeMap |
TreeMap | () | Constructor |
public function TreeMap(init:Boolean = true)
Constructs a new empty instance of spec.TreeMap.
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.
|
clear | () | method |
override public function clear():void
Removes all mappings from this spec.TreeMap, leaving it empty.
See also
clone | () | method |
override public function clone():Object
Answers a new spec.TreeMap with the same mappings, size and comparator as this spec.TreeMap.
ReturnsObject — a shallow copy of this spec.TreeMap
|
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 spec.TreeMap.
ReturnsComparator — a Comparator or null if the natural ordering is used
|
containsKey | () | method |
override public function containsKey(key:Object):Boolean
Searches this spec.TreeMap for the specified key.
Parameters
key:Object — the object to search for
|
Boolean — true if key is a key of this spec.TreeMap, false otherwise
|
TypeError — when the key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the key is null and the comparator cannot handle null
|
containsValue | () | method |
override public function containsValue(value:Object):Boolean
Searches this spec.TreeMap for the specified value.
Parameters
value:Object — the object to search for
|
Boolean — true if value is a value of this spec.TreeMap, false otherwise
|
entrySet | () | method |
override public function entrySet():Set
Answers a Set of the mappings contained in this spec.TreeMap. Each element in the set is a Map.Entry. The set is backed by this spec.TreeMap so changes to one are reflected by the other. The set does not support adding.
ReturnsSet — a Set of the mappings
|
firstKey | () | method |
public function firstKey():Object
Answers the first sorted key in this spec.TreeMap.
ReturnsObject — the first sorted key
|
Error — when this spec.TreeMap is empty
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getValue | () | method |
override public function getValue(key:Object):Object
Answers the value of the mapping with the specified key.
Parameters
key:Object — the key
|
Object — the value of the mapping with the specified key
|
TypeError — when the key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the key is null and the comparator cannot handle null
|
headMap | () | method |
public function headMap(endKey:Object):SortedMap
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys less than the end key. The returned SortedMap is backed by this spec.TreeMap so changes to one are reflected by the other.
Parameters
endKey:Object — the end key
|
SortedMap — a sub-map where the keys are less than endKey
|
TypeError — when the end key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the end key is null and the comparator cannot handle null
|
initTreeMap1 | () | method |
protected final function initTreeMap1():void
Initializes this object. See the documentation of the corresponding factory method newTreeMap1()
for details.
See also
initTreeMap2 | () | method |
protected final function initTreeMap2(comparator:Comparator):void
Initializes this object. See the documentation of the corresponding factory method newTreeMap2()
for details.
Parameters
comparator:Comparator |
See also
initTreeMap3 | () | method |
protected final function initTreeMap3(map:Map):void
Initializes this object. See the documentation of the corresponding factory method newTreeMap3()
for details.
Parameters
map:Map |
See also
initTreeMap4 | () | method |
protected final function initTreeMap4(map:SortedMap):void
Initializes this object. See the documentation of the corresponding factory method newTreeMap4()
for details.
Parameters
map:SortedMap |
See also
keySet | () | method |
override public function keySet():Set
Answers a Set of the keys contained in this spec.TreeMap. The set is backed by this spec.TreeMap so changes to one are reflected by the other. The set does not support adding.
ReturnsSet — a Set of the keys
|
lastKey | () | method |
public function lastKey():Object
Answer the last sorted key in this spec.TreeMap.
ReturnsObject — the last sorted key
|
Error — when this spec.TreeMap is empty
|
newTreeMap1 | () | method |
public static function newTreeMap1():TreeMap
Constructs a new empty instance of spec.TreeMap.
ReturnsTreeMap |
newTreeMap2 | () | method |
public static function newTreeMap2(comparator:Comparator):TreeMap
Constructs a new empty instance of spec.TreeMap which uses the specified Comparator.
Parameters
comparator:Comparator — the Comparator
|
TreeMap |
newTreeMap3 | () | method |
public static function newTreeMap3(map:Map):TreeMap
Constructs a new instance of spec.TreeMap containing the mappings from the specified Map and using the natural ordering.
Parameters
map:Map — the mappings to add
|
TreeMap |
TypeError — when a key in the Map does not implement the Comparable interface, or they keys in the Map cannot be compared
|
newTreeMap4 | () | method |
public static function newTreeMap4(map:SortedMap):TreeMap
Constructs a new instance of spec.TreeMap containing the mappings from the specified SortedMap and using the same Comparator.
Parameters
map:SortedMap — the mappings to add
|
TreeMap |
putAll | () | method |
override public function putAll(map:Map):void
Copies every mapping in the specified Map to this spec.TreeMap.
Parameters
map:Map — the Map to copy mappings from
|
TypeError — when a key in the Map cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when a key in the Map is null and the comparator cannot handle null
|
putValue | () | method |
override public function putValue(key:Object, value:Object):Object
Maps the specified key to the specified value.
Parameters
key:Object — the key
| |
value:Object — the value
|
Object — the value of any previous mapping with the specified key or null if there was no mapping
|
TypeError — when the key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the key is null and the comparator cannot handle null
|
remove | () | method |
override public function remove(key:Object):Object
Removes a mapping with the specified key from this spec.TreeMap.
Parameters
key:Object — the key of the mapping to remove
|
Object — the value of the removed mapping or null if key is not a key in this spec.TreeMap
|
TypeError — when the key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the key is null and the comparator cannot handle null
|
size | () | method |
override public function size():int
Answers the number of mappings in this spec.TreeMap.
Returnsint — the number of mappings in this spec.TreeMap
|
subMap | () | method |
public function subMap(startKey:Object, endKey:Object):SortedMap
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys greater or equal to the start key but less than the end key. The returned SortedMap is backed by this spec.TreeMap so changes to one are reflected by the other.
Parameters
startKey:Object — the start key
| |
endKey:Object — the end key
|
SortedMap — a sub-map where the keys are greater or equal to startKey and less than endKey
|
TypeError — when the start or end key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the start or end key is null and the comparator cannot handle null
|
tailMap | () | method |
public function tailMap(startKey:Object):SortedMap
Answers a SortedMap of the specified portion of this spec.TreeMap which contains keys greater or equal to the start key. The returned SortedMap is backed by this spec.TreeMap so changes to one are reflected by the other.
Parameters
startKey:Object — the start key
|
SortedMap — a sub-map where the keys are greater or equal to startKey
|
TypeError — when the start key cannot be compared with the keys in this spec.TreeMap
| |
ReferenceError — when the start key is null and the comparator cannot handle null
|
values | () | method |
override public function values():Collection
Answers a Collection of the values contained in this spec.TreeMap. The collection is backed by this spec.TreeMap so changes to one are reflected by the other. The collection does not support adding.
ReturnsCollection — a Collection of the values
|