Skip to content
Last updated

API / geotoolkit / gauges / registry / GaugeRegistry / GaugeRegistry

Class: GaugeRegistry

registry.GaugeRegistry.GaugeRegistry

Implements a registry for gauge implementations (factories)

Table of contents

Constructors
  • [new GaugeRegistry()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.gauges.registry.gaugeregistry.gaugeregistry.md#new gaugeregistry())
Methods

Contents

Constructors

new GaugeRegistry()

• new GaugeRegistry()

Methods

clear

▸ clear(): GaugeRegistry

Removes every factory from the registry

Returns

GaugeRegistry


contains

▸ contains(name): boolean

Returns true if a factory with provided name is registered

Parameters

Name Type Description
namestringName of the gauge factory to look for

Returns

boolean


createGauge

▸ createGauge<E&gt;(type?, properties?): ReturnType<GaugesMap[E]["createGauge"]&gt;

Returns an instance of a gauge created by the factory which has been registered with provided name. Returns null if no such factory has been registered

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeE
Optional propertiesParameters<GaugesMap[E][&amp;quot;createGauge&amp;quot;]&gt;[0]properties that have to be overridden

Returns

ReturnType<GaugesMap[E]["createGauge"]&gt;


getClassName

▸ getClassName(): string

Returns

string


getGaugeType

▸ getGaugeType(name): string

Gets the type of the gauge returned by one of the factories registered in this registry and referred by the provided name.

Parameters

Name Type Description
namestringName of the default gauge

Returns

string


register

▸ register(name, factory): GaugeRegistry

Registers a factory to the registry, indexing is done by the name

Parameters

Name Type Description
namestring | Record<string, AbstractFactory&gt; | AbstractFactory[]Name of factory to register
factorystring | AbstractFactoryFactory or its classname to register

Returns

GaugeRegistry


unregister

▸ unregister(name): GaugeRegistry

Removes a factory from the registry

Parameters

Name Type Description
namestringName of the factory which has to be removed

Returns

GaugeRegistry


getClassName

▸ Static getClassName(): string

Returns

string


getDefaultInstance

▸ Static getDefaultInstance(): GaugeRegistry

Gets an instance of gauge registry

Returns

GaugeRegistry

registry


register

▸ Static register(name, factory): GaugeRegistry

Registers in a default factory to the registry, indexing is done by the name

Parameters

Name Type Description
namestringName of factory to register
factorystring | AbstractFactoryFactory or its classname to register

Returns

GaugeRegistry