Constructor
new SubstanceMetadata(substance, equipment, application, ghg, hasDomestic, hasImport, hasExport, energy, initialChargeDomestic, initialChargeImport, initialChargeExport, retirement, retirementWithReplacement, defaultSales)
Create a new SubstanceMetadata instance.
Parameters:
| Name | Type | Description |
|---|---|---|
substance |
string | Name of the substance without equipment type |
equipment |
string | Optional equipment type (added with " - " separator) |
application |
string | Name of the application that consumes this substance |
ghg |
string | GWP conversion value (e.g., "1430 kgCO2e / kg") |
hasDomestic |
boolean | Whether domestic stream is enabled |
hasImport |
boolean | Whether import stream is enabled |
hasExport |
boolean | Whether export stream is enabled |
energy |
string | Annual energy consumption (e.g., "500 kwh / unit") |
initialChargeDomestic |
string | Initial charge for domestic stream |
initialChargeImport |
string | Initial charge for import stream |
initialChargeExport |
string | Initial charge for export stream |
retirement |
string | Retirement rate (e.g., "10% / year") |
retirementWithReplacement |
string | String "true" or "false" for replacement flag |
defaultSales |
string | Sales assumption mode (user-facing value) |
- Source:
Methods
getApplication() → {string}
Get the application name.
- Source:
Returns:
The application name.
- Type
- string
getDefaultSales() → {string}
Get the default sales assumption mode.
- Source:
Returns:
The default sales mode (user-facing value).
- Type
- string
getEnergy() → {string}
Get the energy consumption value.
- Source:
Returns:
The energy consumption value.
- Type
- string
getEquipment() → {string}
Get the equipment type.
- Source:
Returns:
The equipment type.
- Type
- string
getGhg() → {string}
Get the GHG equivalency value.
- Source:
Returns:
The GHG value.
- Type
- string
getHasDomestic() → {boolean}
Check if domestic stream is enabled.
- Source:
Returns:
True if domestic stream is enabled.
- Type
- boolean
getHasExport() → {boolean}
Check if export stream is enabled.
- Source:
Returns:
True if export stream is enabled.
- Type
- boolean
getHasImport() → {boolean}
Check if import stream is enabled.
- Source:
Returns:
True if import stream is enabled.
- Type
- boolean
getInitialChargeDomestic() → {string}
Get the initial charge for domestic stream.
- Source:
Returns:
The initial charge value.
- Type
- string
getInitialChargeExport() → {string}
Get the initial charge for export stream.
- Source:
Returns:
The initial charge value.
- Type
- string
getInitialChargeImport() → {string}
Get the initial charge for import stream.
- Source:
Returns:
The initial charge value.
- Type
- string
getKey() → {string}
Get the CSV key format used by ConsumptionListPresenter.
Returns the format: "substanceName" for "applicationName"
- Source:
Returns:
The key format for CSV operations.
- Type
- string
getName() → {string}
Get the effective name combining substance and equipment type.
Handles concatenation logic similar to getEffectiveName in ui_editor.js.
If equipment type is empty, returns just the substance name.
Otherwise, returns "substance - equipment".
- Source:
Returns:
The effective name for the substance.
- Type
- string
getRetirement() → {string}
Get the retirement rate.
- Source:
Returns:
The retirement rate.
- Type
- string
getRetirementWithReplacement() → {string}
Get the retirement with replacement flag.
- Source:
Returns:
String "true" or "false", or empty string if not set.
- Type
- string
getSubstance() → {string}
Get the substance name (without equipment type).
- Source:
Returns:
The substance name.
- Type
- string