Class baja.OrderedMap
Extends
BaseBajaObj.
Maintains an ordered list of key/value pairs.
This object forms the basis of a Complex's Slot Map.
Defined in: sys.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| <private> |
| Method Attributes | Method Name and Description |
|---|---|
| <private> |
contains(key)
Query the Map to see if it contains the key.
|
| <private> |
get(key)
Return the value for the key.
|
| <private> |
getCursor(context, the)
Return a Cursor used for iteration.
|
| <private> |
getFromIndex(index)
Return the value for the index.
|
| <private> |
getIndex(key)
Return the key's index.
|
| <private> |
getKeys()
Return an ordered array of keys for iteration.
|
| <private> |
getSize()
Return the size of the Map.
|
| <private> |
put(key, val)
Assign the value to the Map with the given key.
|
| <private> |
remove(key)
Remove a value from the map and return it.
|
| <private> |
rename(oldName, newName)
Rename an entry.
|
| <private> |
sort(sortFunc)
Sort the Map.
|
- Methods borrowed from class BaseBajaObj:
- equals, valueOf
Method Detail
<private>
{Boolean}
contains(key)
Query the Map to see if it contains the key.
- Parameters:
- {String} key
- Returns:
- {Boolean} a boolean value indicating if the Map contains the key.
<private>
get(key)
Return the value for the key.
- Parameters:
- {String} key
- Returns:
- the value for the key (return null if key is not found in Map).
<private>
{Cursor}
getCursor(context, the)
Return a Cursor used for iteration.
- Parameters:
- context
- used as 'this' in iteration operations
- {Function} the
- Constructor of the Cursor to use for the Map.
- Returns:
- {Cursor} Cursor used for iteration
<private>
getFromIndex(index)
Return the value for the index.
- Parameters:
- {Number} index
- Returns:
- the value for the index (return null if index is not found in Map).
<private>
{Number}
getIndex(key)
Return the key's index.
- Parameters:
- {String} key
- Returns:
- {Number} the index for the key (return -1 if key is not found in Map).
<private>
{Array}
getKeys()
Return an ordered array of keys for iteration.
Please note, a copy of the internal array will be returned.
- Returns:
- {Array} an array of keys that can be used for iteration.
<private>
{Number}
getSize()
Return the size of the Map.
- Returns:
- {Number} the size of the Map.
<private>
put(key, val)
Assign the value to the Map with the given key.
- Parameters:
- {String} key
- the key used for the entry in the Map
- val
- the value used to store in the Map
<private>
remove(key)
Remove a value from the map and return it.
- Parameters:
- {String} key
- the key used to remove the value.
- Returns:
- the value removed (return null if nothing is found to be removed).
<private>
{Boolean}
rename(oldName, newName)
Rename an entry.
- Parameters:
- {String} oldName
- the name of the existing entry to be renamed.
- {String} newName
- the new name of the entry.
- Returns:
- {Boolean} true if the entry was successfully renamed.
<private>
sort(sortFunc)
Sort the Map.
- Parameters:
- {Function} sortFunc
- Function used to sort the map. This definition of the Function should be the same as the one passed into a JavaScript Array's sort method.
- See:
- Array#sort