Last updated

API / geotoolkit / data / INumericalDataSeries / INumericalDataSeries

Class: INumericalDataSeries

data.INumericalDataSeries.INumericalDataSeries

Define a numerical data interface

Interface

Hierarchy

Implemented by

Table of contents

Constructors
Properties
Methods
Css Properties
Name Type Description
idnumber | stringUnique id of the data series
namestringName
typestringType
uristringUnique resource identifier

Contents

Constructors

new INumericalDataSeries(options)

Protected new INumericalDataSeries(options?)

Parameters

Name Type
Optional optionsOptions

Inherited from

AbstractDataSeries.constructor

Properties

clone

clone: (copyData?: boolean) => INumericalDataSeries

Type declaration

▸ (copyData?): INumericalDataSeries

Parameters
Name Type
Optional copyDataboolean
Returns

INumericalDataSeries

Overrides

AbstractDataSeries.clone

Methods

addChild

addChild(data): INumericalDataSeries

Add a child object

Parameters

Name Type Description
dataDataObject | DataObject[]the child data to be added

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.addChild


addProperties

addProperties(properties): INumericalDataSeries

Add additional properties

Parameters

Name Type Description
propertiesRecord<string, any>additional properties of the dataobject

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.addProperties


clearChildren

clearChildren(): INumericalDataSeries

Remove all child data

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.clearChildren


convertValues

Protected Abstract convertValues<U>(values, fromUnit?, toUnit?): U

Converts values from one unit to another specified unit.

Type parameters

NameType
Uextends any

Parameters

Name Type Description
valuesUarray of values or a single value
Optional fromUnitstring | AbstractUnitthe original unit of the value(s)
Optional toUnitstring | AbstractUnitthe unit to convert the value(s) to

Returns

U

Inherited from

AbstractDataSeries.convertValues


copyConstructor

Protected copyConstructor(src): INumericalDataSeries

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcDataObjectSource to copy from

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.copyConstructor


dispose

dispose(): void

Dispose data object and all children. Clear all listeners

Returns

void

Inherited from

AbstractDataSeries.dispose


getChild

getChild(i): DataObject

Return data by index

Parameters

Name Type Description
inumberindex of the data

Returns

DataObject

child

Inherited from

AbstractDataSeries.getChild


getChildren

getChildren(filter?): Iterator<DataObject>

Return iterator by child data objects

Parameters

Name Type Description
Optional filter(data: DataObject) => booleana filter function. Returns all child data objects if the value is null.

Returns

Iterator<DataObject>

Inherited from

AbstractDataSeries.getChildren


getChildrenCount

getChildrenCount(): number

Return number of child data

Returns

number

Inherited from

AbstractDataSeries.getChildrenCount


getClassName

getClassName(): string

Returns

string

Overrides

AbstractDataSeries.getClassName


getDataOrder

getDataOrder(): Order

Returns data ordering of the data series.

Returns

Order

Inherited from

AbstractDataSeries.getDataOrder


getId

getId(): string | number

Returns the identifier of the data series.

Returns

string | number

Inherited from

AbstractDataSeries.getId


getLength

Abstract getLength(): number

Returns the number of values in the data series.

Returns

number

Inherited from

AbstractDataSeries.getLength


getMax

Abstract getMax(unit?): number

Returns max value

Parameters

Name Type Description
Optional unitstringunit optional output unit to convert the data to (if none specified, data is not converted)

Returns

number

max


getMin

Abstract getMin(unit?): number

Returns min value

Parameters

Name Type Description
Optional unitstringunit optional output unit to convert the data to (if none specified, data is not converted)

Returns

number

min


getName

getName(): string

Returns data object name

Returns

string

Inherited from

AbstractDataSeries.getName


getParent

getParent(): DataObject

Gets parent data item

Returns

DataObject

Inherited from

AbstractDataSeries.getParent


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

JSON options object

Inherited from

AbstractDataSeries.getProperties


getProperty

getProperty(name): any

Gets property by name

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AbstractDataSeries.getProperty


getTimeStamp

Protected getTimeStamp(): number

Returns the timestamp of the data series.

Returns

number

Inherited from

AbstractDataSeries.getTimeStamp


getType

getType(): string

Returns data type

Returns

string

Inherited from

AbstractDataSeries.getType


getUnit

Abstract getUnit(): AbstractUnit

Returns unit of the data series.

Returns

AbstractUnit

unit

Inherited from

AbstractDataSeries.getUnit


getUri

getUri(): string

Returns unique resource identifier

Returns

string

Inherited from

AbstractDataSeries.getUri


getValue

Abstract getValue(index): any

Returns the value at the given index. The type of the returned value depends on the data series type.

Parameters

Name Type
indexnumber

Returns

any

Inherited from

AbstractDataSeries.getValue


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

AbstractDataSeries.hasEventListener


hasProperty

hasProperty(name): boolean

Returns whether data object contains specific property

Parameters

Name Type Description
namestringproperty name

Returns

boolean

Inherited from

AbstractDataSeries.hasProperty


indexOfChild

indexOfChild(data): number

Return index of child data ( index of the specified child or -1 if data is not found)

Parameters

Name Type Description
dataDataObjectdata object to check index

Returns

number

Inherited from

AbstractDataSeries.indexOfChild


insertChild

insertChild(index, item, silent?): INumericalDataSeries

Insert item by index

Parameters

Name Type Description
indexnumberspecified index
itemDataObjectnode
Optional silentbooleanwill not fire any events if true

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.insertChild


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractDataSeries.isDisposed


isReadOnly

Abstract isReadOnly(): boolean

Returns whether the data series is immutable and cannot be changed.

Returns

boolean

Inherited from

AbstractDataSeries.isReadOnly


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractDataSeries.isSilent


notify

notify<E>(type, source, args?): INumericalDataSeries

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceAbstractDataSeries<any>of the event
Optional argsEventMap[E]arguments of the event

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.notify


off

off<E>(type?, callback?): INumericalDataSeries

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: INumericalDataSeries, args: EventMap[E]) => voidfunction to be called

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.off


on

on<E>(type, callback): INumericalDataSeries

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.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: INumericalDataSeries, args: EventMap[E]) => voidto be called

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.on


onPropertyChanged

onPropertyChanged(prop): INumericalDataSeries

This method is called if property bag is changed using setProperty method

Parameters

Name Type Description
propObjectproperty
prop.namestring
prop.valueany

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.onPropertyChanged


query

query(): QueryBuilder<any>

Query data item and child items by different conditions

Example

// Select by function
import {DataObject} from '@int/geotoolkit/data/DataObject';

const dataobject = new DataObject({'name': 'test', 'uri': 'testuri', 'type': 'testtype'});
const item1 = new DataObject({'name': 'item1', 'uri': 'item1', 'type': 'test'});
const item2 = new DataObject({'name': 'item2', 'uri': 'item2', 'type': 'test'});
dataobject.addChild([item1, item2]);
const item5 = new DataObject({'name': 'item5', 'uri': 'item5', 'type': 'test'});
item2.addChild(item5);
let founditem = null;
dataobject.query()
.where( (item: DataObject) => item.getParent() === dataobject)
.where( (item: DataObject) => item.getUri() === 'item2')
.select((item: DataObject) => {
founditem = item;
});

Example

// Select by expression
dataobject.query()
.where( 'item => uri(item) == "item5"')
.select((item: DataObject) => {
founditem = item;
});

Returns

QueryBuilder<any>

query object which has methods 'where' tp specify conditions, 'select' to run query, 'selectToArray' select results to array Expressions syntax: "item => expression", where expression:

  • logical and arithmetic operators
  • embedded functions: name(item) - gets name of the data object url(item) - gets url of the data object type(item) - gets type of the data object

Inherited from

AbstractDataSeries.query


removeChild

removeChild(data, silent?): INumericalDataSeries

Remove child data object

Parameters

Name Type Description
dataDataObjectdata object to be removed
Optional silentbooleanwill not fire any events if true

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.removeChild


set

set(index, item): DataObject

Sets item by index

Parameters

Name Type Description
indexnumberindex of the item
itemDataObjectnode

Returns

DataObject

Inherited from

AbstractDataSeries.set


setId

setId(id): INumericalDataSeries

Sets the identifier of the data series.

Parameters

Name Type Description
idstring | numbera new identifier

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setId


setName

setName(name): INumericalDataSeries

Sets data object name

Parameters

Name Type Description
namestringdata object name

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setName


setParent

setParent(parent): INumericalDataSeries

Sets parent data item

Parameters

Name Type Description
parentDataObjectparent data item

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setParent


setProperties

setProperties(properties?): INumericalDataSeries

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsJSON options object

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setProperties


setProperty

setProperty(name, value): INumericalDataSeries

Sets property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setProperty


setSilent

setSilent(bool): INumericalDataSeries

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setSilent


setType

setType(type): INumericalDataSeries

Sets data object type

Parameters

Name Type Description
typestringdata type

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setType


setUri

setUri(uri): INumericalDataSeries

Sets unique resource identifier

Parameters

Name Type Description
uristringunique identifier

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.setUri


toArray

Abstract toArray(copy?, unit?): any[]

Returns an array of objects in the data series.

Parameters

Name Type Description
Optional copybooleanwhether creating a copy of data
Optional unitstring | AbstractUnitunit optional output unit to convert the data to. if not specified, data will not be converted

Returns

any[]

Inherited from

AbstractDataSeries.toArray


update

update(args?): INumericalDataSeries

Notifies the data series has been updated. The timestamp will be updated and Events.Updated event will be fired.

Fires

Events.Updated

Parameters

Name Type Description
Optional argsObjectevent args
args.countnumber
args.indexnumber
args.typeStateChanges

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.update


updateTimeStamp

Protected updateTimeStamp(): INumericalDataSeries

Updates timestamp of the data series.

Returns

INumericalDataSeries

Inherited from

AbstractDataSeries.updateTimeStamp


updating

updating(args?): INumericalDataSeries

Notifies the data series has been started updating. The Events.Updating event will be fired.

Fires

Events.Updating

Parameters

Name Type Description
Optional argsObjectevent args
args.countnumber
args.indexnumber
args.typeStateChanges

Returns

INumericalDataSeries

this

Inherited from

AbstractDataSeries.updating


getClassName

Static getClassName(): string

Returns

string

Overrides

AbstractDataSeries.getClassName