Class SIUnitDefinition
The most straight-forward implementation of a unit: one that is directly derived from SI units.
Inherited Members
Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public class SIUnitDefinition : IUnit, IEquatable<IUnit>
Constructors
SIUnitDefinition(string, SIUnits)
Initializes a new instance of the SIUnitDefinition class.
Declaration
public SIUnitDefinition(string name, SIUnits units)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the unit. |
| SIUnits | units | The SI units. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
Properties
BaseValue
Gets the base value expressed in SI units (no transformations applied).
Declaration
public double BaseValue { get; }
Property Value
| Type | Description |
|---|---|
| double | The base value. |
SI
Gets the underlying SI units.
Declaration
public SIUnits SI { get; }
Property Value
| Type | Description |
|---|---|
| SIUnits | The SI units. |
Methods
Equals(IUnit)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(IUnit other)
Parameters
| Type | Name | Description |
|---|---|---|
| IUnit | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool |
|
Equals(object)
Determines whether the specified object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
From(double)
Converts a base value expressed strictly in SI units (without transformations) to this unit.
Declaration
public double From(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | The value. |
Returns
| Type | Description |
|---|---|
| double | The value in these units. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToString()
Converts to string.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents this instance. |