var m = new LinkedMap(); m.set('param1', 'A'); m.set('param2', 'B'); m.set('param3', 'C'); alert(m.getKeys()); // param1, param2, param3 var c = new LinkedMap(5, true); for (var i = 0; i < 10; i++) { c.set('entry' + i, false); } alert(c.getKeys()); // entry9, entry8, entry7, entry6, entry5 c.set('entry5', true); c.set('entry1', false); alert(c.getKeys()); // entry1, entry5, entry9, entry8, entry7
goog.structs.LinkedMap |
opt_maxCount
: number=
The maximum number of objects to store in the
LinkedMap. If unspecified or 0, there is no maximum.
|
opt_cache
: boolean=
When set, the LinkedMap stores items in order
from most recently used to least recently used, instead of insertion
order.
|
![]()
Removes all entries in this object.
|
code » | |||
Tests whether a provided value is currently in the LinkedMap. This does not
affect item ordering in cache-style LinkedMaps.
Arguments:
Returns: boolean
Whether the value is in the LinkedMap.
|
code » | |||
Tests whether a provided key is currently in the LinkedMap. This does not
affect item ordering in cache-style LinkedMaps.
|
code » | |||
Calls a function on each item in the LinkedMap and returns true only if every
function call returns a true-like value.
|
code » | |||
Finds a node and updates it to be the most recently used.
Arguments:
Returns: goog.structs.LinkedMap.Node_
The node or null if not found.
|
code » | |||
![]()
Calls a function on each item in the LinkedMap.
Arguments:
|
code » | |||
![]()
Retrieves the value for a given key. If this is a caching LinkedMap, the
entry will become the most recently used.
Arguments:
Returns: VALUE
The retrieved value.
|
code » | |||
No description.
Returns: number
The number of items currently in the LinkedMap.
|
code » | |||
No description.
|
code » | |||
No description.
|
code » | |||
![]()
Appends a node to the list. LinkedMap in cache mode adds new nodes to
the head of the list, otherwise they are appended to the tail. If there is a
maximum size, the list will be truncated if necessary.
Arguments:
|
code » | |||
No description.
Returns: boolean
True if the cache is empty, false if it contains any items.
|
code » | |||
Calls a function on each item in the LinkedMap and returns the results of
those calls in an array.
|
code » | |||
![]()
Returns the value of the first node without making any modifications.
Returns: VALUE
The value of the first node or undefined if the map is empty.
|
code » | |||
![]()
Returns the value of the last node without making any modifications.
Returns: VALUE
The value of the last node or undefined if the map is empty.
|
code » | |||
![]()
Retrieves the value for a given key without updating the entry to be the
most recently used.
Arguments:
Returns: VALUE
The retrieved value.
|
code » | |||
![]()
Removes the last node from the list and returns its value.
Returns: VALUE
The value of the popped node, or undefined if the map was
empty.
|
code » | |||
![]()
Removes the node from the LinkedMap if it is not the head, and returns
the node's value.
Arguments:
Returns: VALUE
The value of the popped node.
|
code » | |||
Removes a value from the LinkedMap based on its key.
|
code » | |||
![]()
Removes a node from the
LinkedMap . It can be overridden to do
further cleanup such as disposing of the node value.
Arguments:
|
code » | |||
![]()
Sets a value for a given key. If this is a caching LinkedMap, this entry
will become the most recently used.
Arguments:
|
code » | |||
![]()
Sets the maximum number of entries allowed in this object, truncating any
excess objects if necessary.
Arguments:
|
code » | |||
![]()
Removes the first node from the list and returns its value.
Returns: VALUE
The value of the popped node, or undefined if the map was
empty.
|
code » | |||
Calls a function on each item in the LinkedMap and returns true if any of
those function calls returns a true-like value.
Arguments:
Returns: boolean
Whether f evaluates to true for at least one item in the
LinkedMap.
|
code » | |||
![]()
Removes elements from the LinkedMap if the given count has been exceeded.
In cache mode removes nodes from the tail of the list. Otherwise removes
nodes from the head.
Arguments:
|
code » |