C# Класс YAMP.Value

Abstract base value for any value type.
Наследование: IRegisterElement
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EmptyTypes System.Type[]

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

Метод Описание
CastStringToDouble ( String value ) : Double

This represents a save cast from a string to a double.

Copy ( ) : Value

Creates a copy of the given object using reflection. Override for using a more specialized version.

Deserialize ( Byte content ) : Value

Creates a new instance from bytes.

Deserialize ( String name, Byte content ) : Value

Creates a new named instance from the content.

Format ( ParseContext context, Double value ) : String

Formats a given double value with the rules of the context.

RegisterElement ( IElementMapping elementMapping ) : void

Registers the element at a certain point.

Serialize ( ) : Byte[]

Converts the instance to bytes.

ToString ( ) : String

Returns a string representation of the value.

ToString ( ParseContext context ) : String

Returns a string representation of the value.

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

Метод Описание
BuildIndex ( Value arg, Int32 max ) : System.Int32[]

Builds the index from the given value.

GetExponent ( Double value ) : Int32

Gets the exponent (10^n) of a double value.

RegisterDivide ( Type left, Type right, Func divide ) : void

Helper for registering a division operator.

RegisterMember ( Type left, Type right, Func member ) : void

Helper for registering a member operator.

RegisterMinus ( Type left, Type right, Func sub ) : void

Helper for registering a minus operator.

RegisterModulo ( Type left, Type right, Func mod ) : void

Helper for registering a modulo operator.

RegisterMultiply ( Type left, Type right, Func multiply ) : void

Helper for registering a multiplication operator.

RegisterOperators ( ) : void

Registers the operators (if there are any).

RegisterPlus ( Type left, Type right, Func add ) : void

Helper for registering a plus operator.

RegisterPower ( Type left, Type right, Func power ) : void

Helper for registering a power operator.

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

Метод Описание
Compose ( ParseContext context, Double value, Int32 decimals, Int32 exponent ) : string
EngineeringFormat ( ParseContext context, Double value, Int32 sign, Int32 U, Int32 L ) : String
ScientificFormat ( ParseContext context, Double value, Int32 sign, Int32 U, Int32 L ) : String
StandardFormat ( ParseContext context, Double v, Int32 sign, Int32 U, Int32 L ) : String
ToSuperScript ( Int32 exp ) : String

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

BuildIndex() защищенный статический Метод

Builds the index from the given value.
protected static BuildIndex ( Value arg, Int32 max ) : System.Int32[]
arg Value The argument to inspect.
max System.Int32 The maximum number of arguments.
Результат System.Int32[]

CastStringToDouble() публичный статический Метод

This represents a save cast from a string to a double.
public static CastStringToDouble ( String value ) : Double
value String The string value.
Результат Double

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

Creates a copy of the given object using reflection. Override for using a more specialized version.
public Copy ( ) : Value
Результат Value

Deserialize() публичный абстрактный Метод

Creates a new instance from bytes.
public abstract Deserialize ( Byte content ) : Value
content Byte The binary content.
Результат Value

Deserialize() публичный статический Метод

Creates a new named instance from the content.
public static Deserialize ( String name, Byte content ) : Value
name String The name of the instance.
content Byte The raw content.
Результат Value

Format() публичный статический Метод

Formats a given double value with the rules of the context.
public static Format ( ParseContext context, Double value ) : String
context ParseContext The context with the rules.
value Double The double precision value.
Результат String

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

Gets the exponent (10^n) of a double value.
protected GetExponent ( Double value ) : Int32
value Double The value to get the exponent from.
Результат System.Int32

RegisterDivide() защищенный статический Метод

Helper for registering a division operator.
protected static RegisterDivide ( Type left, Type right, Func divide ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
divide Func The function to execute.
Результат void

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

Registers the element at a certain point.
public RegisterElement ( IElementMapping elementMapping ) : void
elementMapping IElementMapping
Результат void

RegisterMember() защищенный статический Метод

Helper for registering a member operator.
protected static RegisterMember ( Type left, Type right, Func member ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
member Func The function to execute.
Результат void

RegisterMinus() защищенный статический Метод

Helper for registering a minus operator.
protected static RegisterMinus ( Type left, Type right, Func sub ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
sub Func The function to execute.
Результат void

RegisterModulo() защищенный статический Метод

Helper for registering a modulo operator.
protected static RegisterModulo ( Type left, Type right, Func mod ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
mod Func The function to execute.
Результат void

RegisterMultiply() защищенный статический Метод

Helper for registering a multiplication operator.
protected static RegisterMultiply ( Type left, Type right, Func multiply ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
multiply Func The function to execute.
Результат void

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

Registers the operators (if there are any).
protected RegisterOperators ( ) : void
Результат void

RegisterPlus() защищенный статический Метод

Helper for registering a plus operator.
protected static RegisterPlus ( Type left, Type right, Func add ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
add Func The function to execute.
Результат void

RegisterPower() защищенный статический Метод

Helper for registering a power operator.
protected static RegisterPower ( Type left, Type right, Func power ) : void
left System.Type The type on the left side.
right System.Type The type on the right side.
power Func The function to execute.
Результат void

Serialize() публичный абстрактный Метод

Converts the instance to bytes.
public abstract Serialize ( ) : Byte[]
Результат Byte[]

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

Returns a string representation of the value.
public ToString ( ) : String
Результат String

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

Returns a string representation of the value.
public ToString ( ParseContext context ) : String
context ParseContext The calling context.
Результат String

Описание свойств

EmptyTypes публичное статическое свойство

A little helper for reflection (same as Type.Empty in the full .NET stack).
public static Type[],System EmptyTypes
Результат System.Type[]