C# Класс YAMP.Physics.CombinedUnit

Used to represent combined units -- temporary and defined.
Наследование: PhysicalUnit
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CombinedUnit ( String unit ) : System
ConvertTo ( String unit ) : Double>>.List

Tries to convert the unit to the given unit.

CreateFrom ( String unit ) : CombinedUnit
Divide ( CombinedUnit unit ) : CombinedUnit

Divides the given combined unit by another unit.

Divide ( String unit ) : CombinedUnit

Divides the given combined unit by the string representation of another unit.

Multiply ( CombinedUnit unit ) : CombinedUnit

Multiplies the given combined unit with another combined unit.

Multiply ( String unit ) : CombinedUnit

Multiplies the given combined unit with the string representation of another unit.

Raise ( Double pwr ) : CombinedUnit

Raises the current unit to the specified power, i.e. kg*s --> raised to 2 is kg^2 * s^2.

Simplify ( ) : CombinedUnit

Tries to simplify the current expression by considering combined types.

Sqrt ( ) : CombinedUnit

Takes the square root of the current unit, i.e. raises it to the power 1/2.

ToString ( ) : String
Unpack ( ) : String

Unpacks the given units, i.e. returns the representation of the unit in elementary units.

Защищенные методы

Метод Описание
CombinedUnit ( String combination, Double factor ) : System
Create ( ) : PhysicalUnit
IsNumber ( char ch ) : bool
IsWhiteSpace ( char ch ) : bool

Приватные методы

Метод Описание
AddUnit ( Double>.Dictionary units, String unit, Double exp ) : void
ConvertToDouble ( String s ) : Double
ConvertToInteger ( string s ) : int
Count ( Token token, Token tokens ) : Int32
EatWhile ( Token token, Token tokens, String text, Int32 start ) : String
FindMapping ( String source, Double>.Dictionary target, Int32 sign, Double>.List list ) : String
GetChanges ( CombinedUnit unit, System.Boolean &reversed ) : Double
GetToken ( char ch ) : Token
Parse ( String unit ) : Double>.Dictionary
Parse ( String unit, Double>.Dictionary units ) : void

Описание методов

CombinedUnit() публичный Метод

public CombinedUnit ( String unit ) : System
unit String
Результат System

CombinedUnit() защищенный Метод

protected CombinedUnit ( String combination, Double factor ) : System
combination String
factor Double
Результат System

ConvertTo() публичный Метод

Tries to convert the unit to the given unit.
public ConvertTo ( String unit ) : Double>>.List
unit String The unit (combination) to convert to.
Результат Double>>.List

Create() защищенный Метод

protected Create ( ) : PhysicalUnit
Результат PhysicalUnit

CreateFrom() публичный Метод

public CreateFrom ( String unit ) : CombinedUnit
unit String
Результат CombinedUnit

Divide() публичный Метод

Divides the given combined unit by another unit.
public Divide ( CombinedUnit unit ) : CombinedUnit
unit CombinedUnit The combined unit to divide the current unit.
Результат CombinedUnit

Divide() публичный Метод

Divides the given combined unit by the string representation of another unit.
public Divide ( String unit ) : CombinedUnit
unit String The combined unit to divide the current unit.
Результат CombinedUnit

IsNumber() защищенный Метод

protected IsNumber ( char ch ) : bool
ch char
Результат bool

IsWhiteSpace() защищенный Метод

protected IsWhiteSpace ( char ch ) : bool
ch char
Результат bool

Multiply() публичный Метод

Multiplies the given combined unit with another combined unit.
public Multiply ( CombinedUnit unit ) : CombinedUnit
unit CombinedUnit The combined unit which is multiplied to the current unit.
Результат CombinedUnit

Multiply() публичный Метод

Multiplies the given combined unit with the string representation of another unit.
public Multiply ( String unit ) : CombinedUnit
unit String The unit to multiply the current unit with.
Результат CombinedUnit

Raise() публичный Метод

Raises the current unit to the specified power, i.e. kg*s --> raised to 2 is kg^2 * s^2.
public Raise ( Double pwr ) : CombinedUnit
pwr Double The power to raise the unit with.
Результат CombinedUnit

Simplify() публичный Метод

Tries to simplify the current expression by considering combined types.
public Simplify ( ) : CombinedUnit
Результат CombinedUnit

Sqrt() публичный Метод

Takes the square root of the current unit, i.e. raises it to the power 1/2.
public Sqrt ( ) : CombinedUnit
Результат CombinedUnit

ToString() публичный Метод

public ToString ( ) : String
Результат String

Unpack() публичный Метод

Unpacks the given units, i.e. returns the representation of the unit in elementary units.
public Unpack ( ) : String
Результат String