Last updated

API / geotoolkit / data / DiscreteDataMap / DiscreteDataMap

Class: DiscreteDataMap<T>

data.DiscreteDataMap.DiscreteDataMap

Defines log discrete value map. It maps value ranges or value codes to corresponding values based on continues or discrete type of the map.

Type parameters

NameType
Tany

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
typeMapTypeData type to specify usage codes or ranges

Contents

Constructors

new DiscreteDataMap&lt;T&amp;gt;(options)

new DiscreteDataMap<T>(options?)

Type parameters

NameType
Tany

Parameters

Name Type
Optional optionsOptions<T>

Overrides

EventDispatcher.constructor

Methods

dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getCodes

getCodes(): number[]

Returns array of ranges

Returns

number[]

codes array of codes


getMapType

getMapType(): MapType

Returns data map type

Returns

MapType

map type


getProperties

getProperties(): OptionsOut<T>

Gets all the properties pertaining to this object

Returns

OptionsOut<T>


getRanges

getRanges(): number[][]

Returns array of ranges

Returns

number[][]

ranges array of ranges


getValueAt

getValueAt(value): T

Return mapped object for specified value

Parameters

Name Type Description
valuenumbervalue index

Returns

T

corresponding value


getValues

getValues(): T[]

Returns array of values

Returns

T[]

values list of values


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


notify

notify(type, source, args?): DiscreteDataMap<T>

Notify listeners

Parameters

Name Type Description
typestringevent types
sourceanyof the event
Optional argsanyarguments of the event

Returns

DiscreteDataMap<T>

this

Inherited from

EventDispatcher.notify


off

off(type?, callback?): DiscreteDataMap<T>

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Parameters

Name Type Description
Optional typestringtype of the event
Optional callbackEventListenerfunction to be called

Returns

DiscreteDataMap<T>

this

Inherited from

EventDispatcher.off

off<E>(type, callback): DiscreteDataMap<T>

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: DiscreteDataMap<T>, args: EventMap[E]) => void

Returns

DiscreteDataMap<T>

Inherited from

EventDispatcher.off


on

on(type, callback, options?): DiscreteDataMap<T>

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Parameters

Name Type Description
typestringtype of event or property
callbackEventListenerto be called
Optional optionsOptionsoptions of subscription

Returns

DiscreteDataMap<T>

this

Inherited from

EventDispatcher.on

on<E>(type, callback, options?): DiscreteDataMap<T>

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: DiscreteDataMap<T>, args: EventMap[E]) => void
Optional optionsOptions

Returns

DiscreteDataMap<T>

Inherited from

EventDispatcher.on


setCodes

setCodes(codes): DiscreteDataMap<T>

Sets array of codes

Parameters

Name Type Description
codesnumber[]array of codes

Returns

DiscreteDataMap<T>

this


setMapType

setMapType(mapType): DiscreteDataMap<T>

Sets data map type

Parameters

Name Type Description
mapTypeMapTypemap type

Returns

DiscreteDataMap<T>

this


setProperties

setProperties(properties?): DiscreteDataMap<T>

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T>An object containing the properties to set

Returns

DiscreteDataMap<T>

this


setRanges

setRanges(ranges): DiscreteDataMap<T>

Sets array of ranges

Parameters

Name Type Description
rangesnumber[][]array of ranges

Returns

DiscreteDataMap<T>

this


setSilent

setSilent(bool): DiscreteDataMap<T>

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

DiscreteDataMap<T>

this

Inherited from

EventDispatcher.setSilent


setValues

setValues(values): DiscreteDataMap<T>

Sets array of values

Parameters

Name Type Description
valuesT[]list of values

Returns

DiscreteDataMap<T>

this


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName