Packageorg.as3collections
Interfacepublic interface ISortedMap extends org.as3coreaddendum.system.ISortable, IListMap, IMap, IIterable, org.as3coreaddendum.system.ICloneable, org.as3coreaddendum.system.IEquatable
Implementors SortedArrayListMap, TypedSortedMap

A map that provides a total ordering on its mappings, sorting by keys or values. The map is ordered according to the natural ordering of its keys or values, by a IComparator typically provided at sorted map creation time, or by the arguments provided to the sort or sortOn methods. The sortBy property defines whether the sorting will be made by key or value.



Public Properties
 PropertyDefined By
 InheritedallKeysEquatable : Boolean
[read-only] Indicates whether all keys in this map implements org.as3coreaddendum.system.IEquatable interface.
IMap
 InheritedallValuesEquatable : Boolean
[read-only] Indicates whether all values in this map implements org.as3coreaddendum.system.IEquatable interface.
IMap
 InheritedmodCount : int
[read-only] The number of times this map has been structurally modified.
IListMap
  sortBy : SortMapBy
Defines whether the map should be sorted by its keys or values.
ISortedMap
Public Methods
 MethodDefined By
 Inherited
clear():void
Removes all of the mappings from this map (optional operation).
IMap
 Inherited
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key.
IMap
 Inherited
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value.
IMap
 Inherited
Returns an ICollection object that is a view of the mappings contained in this map.
IMap
 Inherited
getKeyAt(index:int):*
Returns the key at the specified position in this map.
IListMap
 Inherited
Returns an ICollection object that is a view of the keys contained in this map.
IMap
 Inherited
getValue(key:*):*
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
IMap
 Inherited
getValueAt(index:int):*
Returns the value at the specified position in this map.
IListMap
 Inherited
Returns an ICollection object that is a view of the values contained in this map.
IMap
 Inherited
headMap(toKey:*):IListMap
Returns a new IListMap object that is a view of the portion of this map whose keys are strictly less than toKey.
IListMap
 Inherited
indexOfKey(key:*):int
Returns the index of the first occurrence of the specified key in this map, or -1 if this map does not contain the key.
IListMap
 Inherited
indexOfValue(value:*):int
Returns the index of the first occurrence of the specified value in this map, or -1 if this map does not contain the value.
IListMap
 Inherited
isEmpty():Boolean
Returns true if this map contains no key-value mappings.
IMap
 Inherited
Returns an iterator over a set of elements.
IIterable
 Inherited
Returns a IListMapIterator object to iterate over the mappings in this map (in proper sequence), starting at the specified position in this map.
IListMap
 Inherited
put(key:*, value:*):*
Associates the specified value with the specified key in this map (optional operation).
IMap
 Inherited
putAll(map:IMap):void
Copies all of the mappings from the specified map to this map (optional operation).
IMap
 Inherited
putAllAt(index:int, map:IMap):void
Copies all of the mappings from the specified map to this map (optional operation).
IListMap
 Inherited
putAllByObject(o:Object):void
Retrieves each property of the specified object, calling put on this map once for each property (optional operation).
IMap
 Inherited
putAt(index:int, key:*, value:*):void
Associates the specified value with the specified key at the specified position in this map (optional operation).
IListMap
 Inherited
Associates the specified entry.value with the specified entry.key in this map (optional operation).
IMap
 Inherited
remove(key:*):*
Removes the mapping for a key from this map if it is present (optional operation).
IMap
 Inherited
removeAll(keys:ICollection):Boolean
Removes the mapping for a key from this map (if it is present) for each element in the specified collection (optional operation).
IMap
 Inherited
removeAt(index:int):IMapEntry
Removes the mapping at the specified position in this map (optional operation).
IListMap
 Inherited
removeRange(fromIndex:int, toIndex:int):IListMap
Removes all of the mappings whose index is between fromIndex, inclusive, and toIndex, exclusive (optional operation).
IListMap
 Inherited
retainAll(keys:ICollection):Boolean
Retains only the mappings in this map that the keys are contained (as elements) in the specified collection (optional operation).
IMap
 Inherited
reverse():void
Reverses the order of the mappings in this map.
IListMap
 Inherited
setKeyAt(index:int, key:*):*
Replaces the key at the specified position in this map with the specified key (optional operation).
IListMap
 Inherited
setValueAt(index:int, value:*):*
Replaces the value at the specified position in this map with the specified value (optional operation).
IListMap
 Inherited
size():int
Returns the number of key-value mappings in this map.
IMap
  
sortOn(fieldName:*, options:* = null):Array
Sorts the elements in an array according to one or more fields in the array.
ISortedMap
 Inherited
subMap(fromIndex:int, toIndex:int):IListMap
Returns a new IListMap object that is a view of the portion of this map between the specified fromIndex, inclusive, and toIndex, exclusive.
IListMap
 Inherited
tailMap(fromKey:*):IListMap
Returns a new IListMap object that is a view of the portion of this map whose keys are greater than or equal to fromKey.
IListMap
Property Detail
sortByproperty
sortBy:SortMapBy

Defines whether the map should be sorted by its keys or values. The default is SortMapBy.KEY.


Implementation
    public function get sortBy():SortMapBy
    public function set sortBy(value:SortMapBy):void
Method Detail
sortOn()method
public function sortOn(fieldName:*, options:* = null):Array

Sorts the elements in an array according to one or more fields in the array.

Consult Array.sortOn in the ActionScript 3.0 Language Reference in the link below for more info.

Parameters

fieldName:*
 
options:* (default = null)

Returns
Array

See also