API / geotoolkit / gauges / registry / GaugeRegistry / GaugeRegistry
registry.GaugeRegistry.GaugeRegistry
Implements a registry for gauge implementations (factories)
Constructors
Methods
Methods
▸ clear(): GaugeRegistry
Removes every factory from the registry
▸ contains(name): boolean
Returns true if a factory with provided name is registered
| Name | Type | Description |
|---|---|---|
name | string | Name of the gauge factory to look for |
boolean
▸ createGauge<E>(type?, properties?): ReturnType<GaugesMap[E]["createGauge"]>
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
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | |
Optional properties | Parameters<GaugesMap[E]["createGauge"]>[0] | properties that have to be overridden |
ReturnType<GaugesMap[E]["createGauge"]>
▸ getClassName(): string
string
▸ 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.
| Name | Type | Description |
|---|---|---|
name | string | Name of the default gauge |
string
▸ register(name, factory): GaugeRegistry
Registers a factory to the registry, indexing is done by the name
| Name | Type | Description |
|---|---|---|
name | string | Record<string, AbstractFactory> | AbstractFactory[] | Name of factory to register |
factory | string | AbstractFactory | Factory or its classname to register |
▸ unregister(name): GaugeRegistry
Removes a factory from the registry
| Name | Type | Description |
|---|---|---|
name | string | Name of the factory which has to be removed |
▸ Static getClassName(): string
string
▸ Static getDefaultInstance(): GaugeRegistry
Gets an instance of gauge registry
registry
▸ Static register(name, factory): GaugeRegistry
Registers in a default factory to the registry, indexing is done by the name
| Name | Type | Description |
|---|---|---|
name | string | Name of factory to register |
factory | string | AbstractFactory | Factory or its classname to register |