nx.data.SortedMap - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.data.SortedMap Class

Uses

- nx.Observable

Module: nx.data

- Index
- Methods
- Properties

## Item Index

### Methods

- add
- clearBinding
- dispose
- getBinding
- getKeyAt
- getValue
- getValueAt
- indexOf
- notify
- remove
- removeAt
- setBinding
- setValue
- setValueAt
- sort
- toArray
- unwatch

### Properties

- length

## Methods

### `add`

(

- `key`
- `value`
- `index`

)

Add or insert an value with specified key and index.

#### Parameters:

- `key` Object

  Specified key.

- `value` Object

  (Optional) The value, default undefined.

- `index` Object

  (Optional) Specified index, default append.

#### Returns:

The created entry.

### `clearBinding`

(

- `prop`

)

Inherited from nx.Observable:

Clear binding for specified property.

#### Parameters:

- `prop` Object

### ``

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

### `dispose`

()

Inherited from nx.Observable:

Dispose current object.

### `getBinding`

(

- `prop`

)

Inherited from nx.Observable:

Get existing binding object for specified property.

#### Parameters:

- `prop` Object

#### Returns:

:

### `getKeyAt`

(

- `index`

)

Get the key at specified index.

#### Parameters:

- `index` Object

  The index.

#### Returns:

The key, null if not exists.

### `getValue`

(

- `key`

)

Get a value with specified key.

#### Parameters:

- `key` Object

  The value's key.

#### Returns:

The value.

### `getValueAt`

(

- `index`

)

Get a value with speicifed index.

#### Parameters:

- `index` Object

  The value's index.

#### Returns:

The value.

### `indexOf`

(

- `key`

)

Get the index of specified key.

#### Parameters:

- `key` Object

  The key.

#### Returns:

The index, -1 if not exists.

### `notify`

(

- `names`
- `oldValue`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `oldValue` Object

### `remove`

(

- `key`

)

Remove value(s) from SortedMap by key(s).

#### Parameters:

- `key` Object

  The key of value attempt to be removed.

#### Returns:

Removed value.

### `removeAt`

(

- `index`

)

Remove value from SortedMap by index.

#### Parameters:

- `index` Object

  The index of value attempt to be removed.

#### Returns:

Removed value.

### `setBinding`

(

- `prop`
- `expr`
- `source`

)

Inherited from nx.Observable:

Set binding for specified property.

#### Parameters:

- `prop` Object
- `expr` Object
- `source` Object

### `setValue`

(

- `key`
- `value`

)

Change value of specified key.

#### Parameters:

- `key` Object

  The key attempt to be changed.

- `value` Object

  The new value.

#### Returns:

The new value.

### `setValueAt`

(

- `index`
- `value`

)

Change value of speicifed index.

#### Parameters:

- `index` Object

  The index attempt to be changed.

- `value` Object

  The new value.

#### Returns:

The new value.

### `sort`

(

- `comparer`

)

Sort the SortedMap with a comparer function.

#### Parameters:

- `comparer` Object

  A function expecting arguments: key1, value1, key2, value2

### `toArray`

()

Get array of key-value pairs of all entries.

#### Returns:

An array, each item of which is an object with key and value property.

### `unwatch`

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

## Properties

### `length`

Unknown

The length of SortedMap.