C# Class YAMP.Value

Abstract base value for any value type.
Inheritance: IRegisterElement
Afficher le fichier Open project: FlorianRappl/YAMP Class Usage Examples

Méthodes publiques

Свойство Type Description
EmptyTypes System.Type[]

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

BuildIndex() protected static méthode

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.
Résultat System.Int32[]

CastStringToDouble() public static méthode

This represents a save cast from a string to a double.
public static CastStringToDouble ( String value ) : Double
value String The string value.
Résultat Double

Copy() public méthode

Creates a copy of the given object using reflection. Override for using a more specialized version.
public Copy ( ) : Value
Résultat Value

Deserialize() public abstract méthode

Creates a new instance from bytes.
public abstract Deserialize ( Byte content ) : Value
content Byte The binary content.
Résultat Value

Deserialize() public static méthode

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.
Résultat Value

Format() public static méthode

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.
Résultat String

GetExponent() protected méthode

Gets the exponent (10^n) of a double value.
protected GetExponent ( Double value ) : Int32
value Double The value to get the exponent from.
Résultat System.Int32

RegisterDivide() protected static méthode

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.
Résultat void

RegisterElement() public méthode

Registers the element at a certain point.
public RegisterElement ( IElementMapping elementMapping ) : void
elementMapping IElementMapping
Résultat void

RegisterMember() protected static méthode

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.
Résultat void

RegisterMinus() protected static méthode

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.
Résultat void

RegisterModulo() protected static méthode

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.
Résultat void

RegisterMultiply() protected static méthode

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.
Résultat void

RegisterOperators() protected méthode

Registers the operators (if there are any).
protected RegisterOperators ( ) : void
Résultat void

RegisterPlus() protected static méthode

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.
Résultat void

RegisterPower() protected static méthode

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.
Résultat void

Serialize() public abstract méthode

Converts the instance to bytes.
public abstract Serialize ( ) : Byte[]
Résultat Byte[]

ToString() public méthode

Returns a string representation of the value.
public ToString ( ) : String
Résultat String

ToString() public méthode

Returns a string representation of the value.
public ToString ( ParseContext context ) : String
context ParseContext The calling context.
Résultat String

Property Details

EmptyTypes public_oe static_oe property

A little helper for reflection (same as Type.Empty in the full .NET stack).
public static Type[],System EmptyTypes
Résultat System.Type[]