Powered by Zoomin Software. For more details please contactZoomin

HERE Maps API for JavaScript - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Maps API for JavaScript - API Reference: Class: OList

Table of Contents

Class: OList

H.util.OList

new H.util.OList ()

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

Extends

Classes

Event

Methods

add (entry, opt_idx)

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

Name Type Description
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

Fires:

addEventListener (type, handler, opt_capture, opt_scope) inherited

This method adds a listener for a specific event.

Note that to prevent potential memory leaks, you must either call removeEventListener or dispose on the given object when you no longer need it.

addOnDisposeCallback (callback, opt_scope) inherited

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

Name Type Description
callback function

The callback function.

opt_scope Object optional

An optional scope for the callback function

asArray ()Array.<*>

This method retrieves all the entries held in the list as an array.

Returns:
Type Description
Array.<*> An array holding all the entries in the list

dispatchEvent (evt) inherited

This method dispatches an event on the EventTarget object.

Name Type Description
evt H.util.Event | string

An object representing the event or a string with the event name

dispose () inherited

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

flush ()

This method removes all entries from the list.

get (idx)?

This method retrieves the entry at the specified index.

Name Type Description
idx number

The index of the entry to get, a negative index is treated as relative from the end of the list

Throws:

If the given index is out of bounds

Type
H.lang.OutOfRangeError
Returns:
Type Description
? The element at the index provided by the caller

getLength ()number

This method retrieves the length of the list.

Returns:
Type Description
number A value indicating the length of the list as a number of items.

indexOf (entry)number

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

Name Type Description
entry ?

The entry for which to return the index

Returns:
Type Description
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

remove (entry)boolean

This method removes the first entry which is identical with the entry provided by the caller.

Name Type Description
entry ?

An object representing the entry to remove

Fires:
Returns:
Type Description
boolean true to signal that the entry was found in the list and has been removed, otherwise false

removeAt (idx)?

This method removes an entry at the index provided by the caller.

Name Type Description
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

Throws:

If the index provided by the caller is out of bounds

Type
H.lang.InvalidArgumentError
Returns:
Type Description
? An object representing the removed entry

removeEventListener (type, handler, opt_capture, opt_scope) inherited

This method removes a previously added listener from the EventTarget instance.

set (idx, entry)?

This method replaces an entry at the index provided by the caller.

Name Type Description
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 with which to replace an existing entry

Fires:
Throws:

If the given index is out of bounds

Type
H.lang.OutOfRangeError
Returns:
Type Description
? An object representing the replaced entry

Events

add

Event fired when an entry has been added to the list.

Type:

move

Fired when an entry was moved within the list.

Type:

remove

Event fired when an entry has been removed from the list.

Type:

set

Event fired when an entry has been set in the list.

Type:
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert