Maps API for JavaScript Developer's Guide

H.util.OList

Class Summary

Extends: H.util.EventTarget

This class represents an list of ordered entries which dispatches events when the list is modified.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

add (entry, opt_idx)

This method inserts an entry to the list. Optionally it can place new entry at provided index.

removeAt (idx) : {?}

This method removes an entry by a given index from the list.

remove (entry) : {boolean}

This method removes the the first entry which is identical with the given entry.

set (idx, entry) : {?}

This method replaces an entry at the given index with the given entry.

indexOf (entry) : {number}

This method retrieves the index of the first object in this list that is identical with the object supplied by the caller.

get (idx) : {?}

To get the entry at the specified index.

getLength () : {number}

This method returns the length of the list.

asArray () : {Array<*>}

This method returns all list's entries as an array.

flush ()

This method removes all entries from the list.

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

dispatchEvent (evt)

This method will dispatch event on the event target object

dispose ()

Removes listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners.

addOnDisposeCallback (callback, opt_scope)

This method adds callback which is triggered when the object is being disposed

Events Summary

Table 2. Events
Events

add : {H.util.OList.Event}

Fired when an entry was added to the list.

remove : {H.util.OList.Event}

Fired when an entry was removed from the list.

set : {H.util.OList.Event}

Fired when an entry was set in the list.

move : {H.util.OList.Event}

Fired when an entry was moved within the list.

Class Description

This class represents an list of ordered entries which dispatches events when the list is modified.

Constructor Details

H.util.OList()

Method Details

add (entry, opt_idx)

This method inserts an entry to the list. Optionally it can place new entry at provided index.

Parameters:
 
entry:
{?}
 
The entry to insert
opt_idx:
{number=} [optional]
 
The index where the new entry should be inserted; if omitted or greater then the current size of the list, the entry is added at the end of the list; a negative index is treated as being relative from the end of the list

removeAt (idx) : {?}

This method removes an entry by a given index from the list.

Parameters:
 
idx:
{number}
 
The index of the entry which should be removed; a negative index is treated as being relative from the end of the list
Returns:
 
{?}
The removed entry

remove (entry) : {boolean}

This method removes the the first entry which is identical with the given entry.

Parameters:
 
entry:
{?}
 
The entry to remove
Returns:
 
{boolean}
signals if the entry could be found in the list and is removed

set (idx, entry) : {?}

This method replaces an entry at the given index with the given entry.

Parameters:
 
idx:
{number}
 
The index of the entry which should be replaced; a negative index is treated as being relative from the end of the list
entry:
{?}
 
The entry which replaces the existing one
Returns:
 
{?}
The replaced entry

indexOf (entry) : {number}

This method retrieves the index of the first object in this list that is identical with the object supplied by the caller.

Parameters:
 
entry:
{?}
 
The entry for which to return the index.
Returns:
 
{number}
The index of the first matching entry in this list or -1 if the entry provided by the caller is not found in the list

get (idx) : {?}

To get the entry at the specified index.

Parameters:
 
idx:
{number}
 
The index of the entry to get a negative index is treated as being relative from the end of the list
Returns:
 
{?}
The element at the given index

getLength () : {number}

This method returns the length of the list.

Returns:
 
{number}

asArray () : {Array<*>}

This method returns all list's entries as an array.

Returns:
 
{Array<*>}
The list as an array

flush ()

This method removes all entries from the list.

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object. Keep in mind, that you must removeEventListener manually or dispose an object when you no longer need it. Otherwise memory leak is possible.

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
event handler function
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
previously added event handler
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

dispatchEvent (evt)

This method will dispatch event on the event target object

Parameters:
 
evt:
{(H.util.Event | string)}
 
event object or event name

dispose ()

Removes listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners.

addOnDisposeCallback (callback, opt_scope)

This method adds callback which is triggered when the object is being disposed

Parameters:
 
callback:
{!Function}
 
The callback function.
opt_scope:
{Object=} [optional]
 
An optional scope to call the callback in.

Event Details

add: {H.util.OList.Event}

Fired when an entry was added to the list.

remove: {H.util.OList.Event}

Fired when an entry was removed from the list.

set: {H.util.OList.Event}

Fired when an entry was set in the list.

move: {H.util.OList.Event}

Fired when an entry was moved within the list.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.