C# Class YAMP.Physics.PhysicalUnit

Represents an (in its essence elementary) physical unit.
Show file Open project: FlorianRappl/YAMP Class Usage Examples

Protected Properties

Property Type Description
CombinedUnits CombinedUnit>.Dictionary
KnownUnits PhysicalUnit>.Dictionary

Public Methods

Method Description
Add ( String target, Double rate ) : PhysicalUnit

Adds a conversion determined by y = a * x.

Add ( String target, Double rate, Double offset ) : PhysicalUnit

Adds a conversion determined by y = a * x + b.

CanBe ( String unit ) : System.Boolean
FindCombinedUnit ( String unit ) : CombinedUnit
FindUnit ( String unit ) : PhysicalUnit
GetConversion ( String unit ) : Double>.Func
GetInverseConversion ( String unit ) : Double>.Func
HasConversion ( String target ) : System.Boolean
IsCombinedUnit ( String unit ) : System.Boolean
TransformTo ( String unit ) : PhysicalUnit

Protected Methods

Method Description
Create ( ) : PhysicalUnit
GetWeight ( String unit ) : Double
SetPrefixes ( ) : void

Private Methods

Method Description
Identity ( Double x ) : Double
PhysicalUnit ( ) : System

Method Details

Add() public method

Adds a conversion determined by y = a * x.
public Add ( String target, Double rate ) : PhysicalUnit
target String The target unit, e.g. in m to yd, yd would be the target unit.
rate Double The rate of the conversion.
return PhysicalUnit

Add() public method

Adds a conversion determined by y = a * x + b.
public Add ( String target, Double rate, Double offset ) : PhysicalUnit
target String The target unit, e.g. in K to °C, °C would be the target unit.
rate Double The rate (a) of the conversion.
offset Double The offset (b) of the conversion.
return PhysicalUnit

CanBe() public method

public CanBe ( String unit ) : System.Boolean
unit String
return System.Boolean

Create() protected abstract method

protected abstract Create ( ) : PhysicalUnit
return PhysicalUnit

FindCombinedUnit() public static method

public static FindCombinedUnit ( String unit ) : CombinedUnit
unit String
return CombinedUnit

FindUnit() public static method

public static FindUnit ( String unit ) : PhysicalUnit
unit String
return PhysicalUnit

GetConversion() public method

public GetConversion ( String unit ) : Double>.Func
unit String
return Double>.Func

GetInverseConversion() public method

public GetInverseConversion ( String unit ) : Double>.Func
unit String
return Double>.Func

GetWeight() protected method

protected GetWeight ( String unit ) : Double
unit String
return Double

HasConversion() public method

public HasConversion ( String target ) : System.Boolean
target String
return System.Boolean

IsCombinedUnit() public static method

public static IsCombinedUnit ( String unit ) : System.Boolean
unit String
return System.Boolean

SetPrefixes() protected method

protected SetPrefixes ( ) : void
return void

TransformTo() public method

public TransformTo ( String unit ) : PhysicalUnit
unit String
return PhysicalUnit

Property Details

CombinedUnits protected static property

protected static Dictionary CombinedUnits
return CombinedUnit>.Dictionary

KnownUnits protected static property

protected static Dictionary KnownUnits
return PhysicalUnit>.Dictionary