C# Класс 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.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
MaxValue VoltDB.ThirdParty.Math.BigDecimal
MinValue VoltDB.ThirdParty.Math.BigDecimal
NullValue VoltDB.ThirdParty.Math.BigDecimal

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

Метод Описание
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 !=

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

Метод Описание
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.

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

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

Overrides Equals operator
public Equals ( object o ) : bool
o object Object to compare this instance with.
Результат bool

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

Returns a hashcode for the current instance.
public GetHashCode ( ) : int
Результат int

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

Returns whether the variable corresponds to a null VoltDB value.
public IsVoltDBNull ( ) : bool
Результат bool

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

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.
Результат VoltDecimal

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

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.
Результат VoltDecimal

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

Returns the bytes for thie BigDecimal instance, for serialization.
public ToBytes ( ) : byte[]
Результат byte[]

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

Override ToString operator to provide a string representation of the number.
public ToString ( ) : string
Результат string

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

Creates a new decimal from a generic BigDecimal value.
public VoltDecimal ( BigDecimal num ) : System
num VoltDB.ThirdParty.Math.BigDecimal Value used for initialization.
Результат System

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

Creates a new decimal from a BigInteger value.
public VoltDecimal ( BigInteger num ) : System
num VoltDB.ThirdParty.Math.BigInteger Value used for initialization.
Результат System

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

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.
Результат System

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

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.
Результат System

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

Creates a new decimal from a decimal value.
public VoltDecimal ( decimal num ) : System
num decimal Value used for initialization.
Результат System

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

Creates a new decimal from a double value.
public VoltDecimal ( double num ) : System
num double Value used for initialization.
Результат System

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

Creates a new decimal from a long value.
public VoltDecimal ( long num ) : System
num long Value used for initialization.
Результат System

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

Creates a new decimal from a string value.
public VoltDecimal ( string num ) : System
num string Value used for initialization.
Результат System

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

Creates a new decimal from a ulong value.
public VoltDecimal ( ulong num ) : System
num ulong Value used for initialization.
Результат System

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

Operator definition: binary *
public static operator ( ) : VoltDecimal
Результат VoltDecimal

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

Operator definition: binary !=
public static operator ( ) : bool
Результат bool

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

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

MaxValue definition
public static BigDecimal,VoltDB.ThirdParty.Math MaxValue
Результат VoltDB.ThirdParty.Math.BigDecimal

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

MinValue definition
public static BigDecimal,VoltDB.ThirdParty.Math MinValue
Результат VoltDB.ThirdParty.Math.BigDecimal

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

NullValue definition
public static BigDecimal,VoltDB.ThirdParty.Math NullValue
Результат VoltDB.ThirdParty.Math.BigDecimal