C# Class VoltDB.Data.Client.VoltDecimal

Define the Volt-specific decimal(38,12) structure over the standard Java-like implementation of BigDecimal. Full operator support provided. Some methods removed, consistent with the fixed-sclae behavior.
All conversion and mathematical operations maintain the fixed scale at 12 digits -> some operations might lose precision or throw overflow exceptions.
Afficher le fichier Open project: VoltDB/voltdb-client-csharp Class Usage Examples

Méthodes publiques

Свойство Type Description
MaxValue VoltDB.ThirdParty.Math.BigDecimal
MinValue VoltDB.ThirdParty.Math.BigDecimal
NullValue VoltDB.ThirdParty.Math.BigDecimal

Méthodes publiques

Méthode Description
Equals ( object o ) : bool

Overrides Equals operator

GetHashCode ( ) : int

Returns a hashcode for the current instance.

IsVoltDBNull ( ) : bool

Returns whether the variable corresponds to a null VoltDB value.

MovePointLeft ( int n ) : VoltDecimal

Moves the decimal point to the left (essentially: divide by 10^n)

MovePointRight ( int n ) : VoltDecimal

Moves the decimal point to the left (essentially: multiply by 10^n)

ToBytes ( ) : byte[]

Returns the bytes for thie BigDecimal instance, for serialization.

ToString ( ) : string

Override ToString operator to provide a string representation of the number.

VoltDecimal ( BigDecimal num ) : System

Creates a new decimal from a generic BigDecimal value.

VoltDecimal ( BigInteger num ) : System

Creates a new decimal from a BigInteger value.

VoltDecimal ( BigInteger num, int scale ) : System

Creates a new decimal from a BigInteger value and optional scale (will be redefined to FixedScale after original initialization).

VoltDecimal ( byte data ) : System

Creates a new instance of the BigDecimal data type, from the deserialization data.

VoltDecimal ( decimal num ) : System

Creates a new decimal from a decimal value.

VoltDecimal ( double num ) : System

Creates a new decimal from a double value.

VoltDecimal ( long num ) : System

Creates a new decimal from a long value.

VoltDecimal ( string num ) : System

Creates a new decimal from a string value.

VoltDecimal ( ulong num ) : System

Creates a new decimal from a ulong value.

operator ( ) : VoltDecimal

Operator definition: binary *

operator ( ) : bool

Operator definition: binary !=

Private Methods

Méthode Description
IsValidValue ( BigDecimal value ) : bool

Returns whether a given BigDecimal value fits within the restrictions of the VoltDecimal type.

ValidOrThrow ( BigDecimal value ) : void

Checks a value and, in case of validation failure throws an exception.

Method Details

Equals() public méthode

Overrides Equals operator
public Equals ( object o ) : bool
o object Object to compare this instance with.
Résultat bool

GetHashCode() public méthode

Returns a hashcode for the current instance.
public GetHashCode ( ) : int
Résultat int

IsVoltDBNull() public méthode

Returns whether the variable corresponds to a null VoltDB value.
public IsVoltDBNull ( ) : bool
Résultat bool

MovePointLeft() public méthode

Moves the decimal point to the left (essentially: divide by 10^n)
public MovePointLeft ( int n ) : VoltDecimal
n int Number of digits to shift by.
Résultat VoltDecimal

MovePointRight() public méthode

Moves the decimal point to the left (essentially: multiply by 10^n)
public MovePointRight ( int n ) : VoltDecimal
n int Number of digits to shift by.
Résultat VoltDecimal

ToBytes() public méthode

Returns the bytes for thie BigDecimal instance, for serialization.
public ToBytes ( ) : byte[]
Résultat byte[]

ToString() public méthode

Override ToString operator to provide a string representation of the number.
public ToString ( ) : string
Résultat string

VoltDecimal() public méthode

Creates a new decimal from a generic BigDecimal value.
public VoltDecimal ( BigDecimal num ) : System
num VoltDB.ThirdParty.Math.BigDecimal Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a BigInteger value.
public VoltDecimal ( BigInteger num ) : System
num VoltDB.ThirdParty.Math.BigInteger Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a BigInteger value and optional scale (will be redefined to FixedScale after original initialization).
public VoltDecimal ( BigInteger num, int scale ) : System
num VoltDB.ThirdParty.Math.BigInteger Value used for initialization.
scale int Scale of the decimal value to create.
Résultat System

VoltDecimal() public méthode

Creates a new instance of the BigDecimal data type, from the deserialization data.
public VoltDecimal ( byte data ) : System
data byte Binary data as provided by the server's response.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a decimal value.
public VoltDecimal ( decimal num ) : System
num decimal Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a double value.
public VoltDecimal ( double num ) : System
num double Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a long value.
public VoltDecimal ( long num ) : System
num long Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a string value.
public VoltDecimal ( string num ) : System
num string Value used for initialization.
Résultat System

VoltDecimal() public méthode

Creates a new decimal from a ulong value.
public VoltDecimal ( ulong num ) : System
num ulong Value used for initialization.
Résultat System

operator() public static méthode

Operator definition: binary *
public static operator ( ) : VoltDecimal
Résultat VoltDecimal

operator() public static méthode

Operator definition: binary !=
public static operator ( ) : bool
Résultat bool

Property Details

MaxValue public_oe static_oe property

MaxValue definition
public static BigDecimal,VoltDB.ThirdParty.Math MaxValue
Résultat VoltDB.ThirdParty.Math.BigDecimal

MinValue public_oe static_oe property

MinValue definition
public static BigDecimal,VoltDB.ThirdParty.Math MinValue
Résultat VoltDB.ThirdParty.Math.BigDecimal

NullValue public_oe static_oe property

NullValue definition
public static BigDecimal,VoltDB.ThirdParty.Math NullValue
Résultat VoltDB.ThirdParty.Math.BigDecimal