Packagecom.yworks.bridge.util
Interfacepublic interface SortedMap extends Map
Implementors TreeMap

SortedMap is a Map where the iterators sequence in order of the sorted keys.



Public Properties
 PropertyDefined By
 Inheritedempty : Boolean
[read-only] Answers if this Map has no elements, a size of zero.
Map
Public Methods
 MethodDefined By
 Inherited
clear():void
Removes all elements from this Map, leaving it empty.
Map
  
Answers the Comparator used to compare elements in this SortedMap.
SortedMap
 Inherited
containsKey(key:Object):Boolean
Searches this Map for the specified key.
Map
 Inherited
containsValue(value:Object):Boolean
Searches this Map for the specified value.
Map
 Inherited
Returns a Set whose elements comprise all of the mappings that are to be found in this Map.
Map
  
firstKey():Object
Answer the first sorted key in this SortedMap.
SortedMap
 Inherited
getValue(key:Object):Object
Answers the value of the mapping with the specified key.
Map
  
headMap(endKey:Object):SortedMap
Answers a SortedMap of the specified portion of this SortedMap which contains keys less than the end key.
SortedMap
 Inherited
Answers a Set of the keys contained in this Map.
Map
  
lastKey():Object
Answers the last sorted key in this SortedMap.
SortedMap
 Inherited
putAll(map:Map):void
Copies every mapping in the specified Map to this Map.
Map
 Inherited
putValue(key:Object, value:Object):Object
Maps the specified key to the specified value.
Map
 Inherited
remove(key:Object):Object
Removes a mapping with the specified key from this Map.
Map
 Inherited
size():int
Answers the number of elements in this Map.
Map
  
subMap(startKey:Object, endKey:Object):SortedMap
Answers a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key but less than the end key.
SortedMap
  
tailMap(startKey:Object):SortedMap
Answers a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key.
SortedMap
 Inherited
Returns all of the current Map values in a Collection.
Map
Method Detail
comparator()method
public function comparator():Comparator

Answers the Comparator used to compare elements in this SortedMap.

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

Answer the first sorted key in this SortedMap.

Returns
Object — the first sorted key

Throws
Error — when this SortedMap is empty
headMap()method 
public function headMap(endKey:Object):SortedMap

Answers a SortedMap of the specified portion of this SortedMap which contains keys less than the end key. Users should be aware that the return value is actually backed by this SortedMap. Hence any modifications made to one will be immediately visible to the other.

Parameters

endKey:Object — the end key

Returns
SortedMap — a submap where the keys are less than endKey

Throws
TypeError — when the class of the end key is inappropriate for this SubMap
 
ReferenceError — when the end key is null and this SortedMap does not support null keys
lastKey()method 
public function lastKey():Object

Answers the last sorted key in this SortedMap.

Returns
Object — the last sorted key

Throws
Error — when this SortedMap is empty
subMap()method 
public function subMap(startKey:Object, endKey:Object):SortedMap

Answers a SortedMap of the specified portion of this SortedMap which contains keys greater or equal to the start key but less than the end key. Users should be aware that the return value is actually backed by this SortedMap. Hence any modifications made to one will be immediately visible to the other.

Parameters

startKey:Object — the start key
 
endKey:Object — the end key

Returns
SortedMap — a submap where the keys are greater or equal to startKey and less than endKey

Throws
TypeError — when the class of the start or end key is inappropriate for this SubMap
 
ReferenceError — when the start or end key is null and this SortedMap does not support null keys
 
IllegalArgumentException — when the start key is greater than the end key
tailMap()method 
public function tailMap(startKey:Object):SortedMap

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

Parameters

startKey:Object — the start key

Returns
SortedMap — a submap where the keys are greater or equal to startKey

Throws
TypeError — when the class of the start key is inappropriate for this SubMap
 
ReferenceError — when the start key is null and this SortedMap does not support null keys