Avro C#
Public Member Functions | Static Public Member Functions | Properties | List of all members
Avro.AvroDecimal Struct Reference

Represents a big decimal. More...

Inheritance diagram for Avro.AvroDecimal:

Public Member Functions

 AvroDecimal (double value)
 Initializes a new instance of the AvroDecimal class from a given double. More...
 
 AvroDecimal (float value)
 Initializes a new instance of the AvroDecimal class from a given float. More...
 
 AvroDecimal (decimal value)
 Initializes a new instance of the AvroDecimal class from a given decimal. More...
 
 AvroDecimal (int value)
 Initializes a new instance of the AvroDecimal class from a given int. More...
 
 AvroDecimal (long value)
 Initializes a new instance of the AvroDecimal class from a given long. More...
 
 AvroDecimal (uint value)
 Initializes a new instance of the AvroDecimal class from a given unsigned int. More...
 
 AvroDecimal (ulong value)
 Initializes a new instance of the AvroDecimal class from a given unsigned long. More...
 
 AvroDecimal (BigInteger unscaledValue, int scale)
 Initializes a new instance of the AvroDecimal class from a given BigInteger and a scale. More...
 
override string ToString ()
 Converts the current AvroDecimal to a string. More...
 
ToType< T > ()
 Converts the numeric value of the current AvroDecimal to a given type. More...
 
object IConvertible. ToType (Type conversionType, IFormatProvider provider)
 Converts the numeric value of the current AvroDecimal to a given type. More...
 
override bool Equals (object obj)
 Returns a value that indicates whether the current AvroDecimal and a specified object have the same value. More...
 
override int GetHashCode ()
 Returns the hash code for the current AvroDecimal. More...
 
TypeCode IConvertible. GetTypeCode ()
 Returns the TypeCode for the current AvroDecimal. More...
 
bool IConvertible. ToBoolean (IFormatProvider provider)
 Converts the current AvroDecimal to a boolean. More...
 
byte IConvertible. ToByte (IFormatProvider provider)
 Converts the current AvroDecimal to a byte. More...
 
char IConvertible. ToChar (IFormatProvider provider)
 Converts the current AvroDecimal to a char. More...
 
DateTime IConvertible. ToDateTime (IFormatProvider provider)
 Converts the current AvroDecimal to a DateTime. More...
 
decimal IConvertible. ToDecimal (IFormatProvider provider)
 Converts the current AvroDecimal to a decimal. More...
 
double IConvertible. ToDouble (IFormatProvider provider)
 Converts the current AvroDecimal to a double. More...
 
short IConvertible. ToInt16 (IFormatProvider provider)
 Converts the current AvroDecimal to a short. More...
 
int IConvertible. ToInt32 (IFormatProvider provider)
 Converts the current AvroDecimal to an int. More...
 
long IConvertible. ToInt64 (IFormatProvider provider)
 Converts the current AvroDecimal to a long. More...
 
sbyte IConvertible. ToSByte (IFormatProvider provider)
 Converts the current AvroDecimal to a signed byte. More...
 
float IConvertible. ToSingle (IFormatProvider provider)
 Converts the current AvroDecimal to a float. More...
 
string IConvertible. ToString (IFormatProvider provider)
 Converts the current AvroDecimal to a string. More...
 
ushort IConvertible. ToUInt16 (IFormatProvider provider)
 Converts the current AvroDecimal to an unsigned short. More...
 
uint IConvertible. ToUInt32 (IFormatProvider provider)
 Converts the current AvroDecimal to an unsigned int. More...
 
ulong IConvertible. ToUInt64 (IFormatProvider provider)
 Converts the current AvroDecimal to an unsigned long. More...
 
string ToString (string format, IFormatProvider formatProvider)
 Converts the current AvroDecimal to a string. More...
 
int CompareTo (object obj)
 Compares the value of the current AvroDecimal to the value of another object. More...
 
int CompareTo (AvroDecimal other)
 Compares the value of the current AvroDecimal to the value of another AvroDecimal. More...
 
bool Equals (AvroDecimal other)
 Returns a value that indicates whether the current AvroDecimal has the same value as another AvroDecimal. More...
 

Static Public Member Functions

static bool operator== (AvroDecimal left, AvroDecimal right)
 
static bool operator!= (AvroDecimal left, AvroDecimal right)
 
static bool operator> (AvroDecimal left, AvroDecimal right)
 
static bool operator>= (AvroDecimal left, AvroDecimal right)
 
static bool operator< (AvroDecimal left, AvroDecimal right)
 
static bool operator<= (AvroDecimal left, AvroDecimal right)
 
static bool operator== (AvroDecimal left, decimal right)
 
static bool operator!= (AvroDecimal left, decimal right)
 
static bool operator> (AvroDecimal left, decimal right)
 
static bool operator>= (AvroDecimal left, decimal right)
 
static bool operator< (AvroDecimal left, decimal right)
 
static bool operator<= (AvroDecimal left, decimal right)
 
static bool operator== (decimal left, AvroDecimal right)
 
static bool operator!= (decimal left, AvroDecimal right)
 
static bool operator> (decimal left, AvroDecimal right)
 
static bool operator>= (decimal left, AvroDecimal right)
 
static bool operator< (decimal left, AvroDecimal right)
 
static bool operator<= (decimal left, AvroDecimal right)
 
static operator byte (AvroDecimal value)
 
static byte ToByte (AvroDecimal value)
 Creates a byte from a given AvroDecimal. More...
 
static operator sbyte (AvroDecimal value)
 
static sbyte ToSByte (AvroDecimal value)
 Creates a signed byte from a given AvroDecimal. More...
 
static operator short (AvroDecimal value)
 
static short ToInt16 (AvroDecimal value)
 Creates a short from a given AvroDecimal. More...
 
static operator int (AvroDecimal value)
 
static int ToInt32 (AvroDecimal value)
 Creates an int from a given AvroDecimal. More...
 
static operator long (AvroDecimal value)
 
static long ToInt64 (AvroDecimal value)
 Creates a long from a given AvroDecimal. More...
 
static operator ushort (AvroDecimal value)
 
static ushort ToUInt16 (AvroDecimal value)
 Creates an unsigned short from a given AvroDecimal. More...
 
static operator uint (AvroDecimal value)
 
static uint ToUInt32 (AvroDecimal value)
 Creates an unsigned int from a given AvroDecimal. More...
 
static operator ulong (AvroDecimal value)
 
static ulong ToUInt64 (AvroDecimal value)
 Creates an unsigned long from a given AvroDecimal. More...
 
static operator float (AvroDecimal value)
 
static float ToSingle (AvroDecimal value)
 Creates a double from a given AvroDecimal. More...
 
static operator double (AvroDecimal value)
 
static double ToDouble (AvroDecimal value)
 Creates a double from a given AvroDecimal. More...
 
static operator decimal (AvroDecimal value)
 
static decimal ToDecimal (AvroDecimal value)
 Creates a decimal from a given AvroDecimal. More...
 
static operator BigInteger (AvroDecimal value)
 
static BigInteger ToBigInteger (AvroDecimal value)
 Creates a BigInteger from a given AvroDecimal. More...
 
static implicit operator AvroDecimal (byte value)
 
static implicit operator AvroDecimal (sbyte value)
 
static implicit operator AvroDecimal (short value)
 
static implicit operator AvroDecimal (int value)
 
static implicit operator AvroDecimal (long value)
 
static implicit operator AvroDecimal (ushort value)
 
static implicit operator AvroDecimal (uint value)
 
static implicit operator AvroDecimal (ulong value)
 
static implicit operator AvroDecimal (float value)
 
static implicit operator AvroDecimal (double value)
 
static implicit operator AvroDecimal (decimal value)
 
static implicit operator AvroDecimal (BigInteger value)
 

Properties

BigInteger UnscaledValue [get]
 Gets the unscaled integer value represented by the current AvroDecimal. More...
 
int Scale [get]
 Gets the scale of the current AvroDecimal. More...
 

Detailed Description

Represents a big decimal.

Constructor & Destructor Documentation

◆ AvroDecimal() [1/8]

Avro.AvroDecimal.AvroDecimal ( double  value)
inline

Initializes a new instance of the AvroDecimal class from a given double.

Parameters
valueThe double value.

◆ AvroDecimal() [2/8]

Avro.AvroDecimal.AvroDecimal ( float  value)
inline

Initializes a new instance of the AvroDecimal class from a given float.

Parameters
valueThe float value.

◆ AvroDecimal() [3/8]

Avro.AvroDecimal.AvroDecimal ( decimal  value)
inline

Initializes a new instance of the AvroDecimal class from a given decimal.

Parameters
valueThe decimal value.

◆ AvroDecimal() [4/8]

Avro.AvroDecimal.AvroDecimal ( int  value)
inline

Initializes a new instance of the AvroDecimal class from a given int.

Parameters
valueThe int value.

◆ AvroDecimal() [5/8]

Avro.AvroDecimal.AvroDecimal ( long  value)
inline

Initializes a new instance of the AvroDecimal class from a given long.

Parameters
valueThe long value.

◆ AvroDecimal() [6/8]

Avro.AvroDecimal.AvroDecimal ( uint  value)
inline

Initializes a new instance of the AvroDecimal class from a given unsigned int.

Parameters
valueThe unsigned int value.

◆ AvroDecimal() [7/8]

Avro.AvroDecimal.AvroDecimal ( ulong  value)
inline

Initializes a new instance of the AvroDecimal class from a given unsigned long.

Parameters
valueThe unsigned long value.

◆ AvroDecimal() [8/8]

Avro.AvroDecimal.AvroDecimal ( BigInteger  unscaledValue,
int  scale 
)
inline

Initializes a new instance of the AvroDecimal class from a given BigInteger and a scale.

Parameters
unscaledValueThe double value.
scaleThe scale.

Member Function Documentation

◆ CompareTo() [1/2]

int Avro.AvroDecimal.CompareTo ( AvroDecimal  other)
inline

Compares the value of the current AvroDecimal to the value of another AvroDecimal.

Parameters
otherThe AvroDecimal to compare.
Returns
A value that indicates the relative order of the AvroDecimal instances being compared.

◆ CompareTo() [2/2]

int Avro.AvroDecimal.CompareTo ( object  obj)
inline

Compares the value of the current AvroDecimal to the value of another object.

Parameters
objThe object to compare.
Returns
A value that indicates the relative order of the objects being compared.

◆ Equals() [1/2]

bool Avro.AvroDecimal.Equals ( AvroDecimal  other)
inline

Returns a value that indicates whether the current AvroDecimal has the same value as another AvroDecimal.

Parameters
otherThe AvroDecimal to compare.
Returns
true if the current AvroDecimal has the same value as other ; otherwise false.

◆ Equals() [2/2]

override bool Avro.AvroDecimal.Equals ( object  obj)
inline

Returns a value that indicates whether the current AvroDecimal and a specified object have the same value.

Parameters
objThe object to compare.
Returns
true if the obj argument is an AvroDecimal object, and its value is equal to the value of the current AvroDecimal instance; otherwise false.

◆ GetHashCode()

override int Avro.AvroDecimal.GetHashCode ( )
inline

Returns the hash code for the current AvroDecimal.

Returns
The hash code.

◆ GetTypeCode()

TypeCode IConvertible. Avro.AvroDecimal.GetTypeCode ( )
inline

Returns the TypeCode for the current AvroDecimal.

Returns
TypeCode.Object.

◆ ToBigInteger()

static BigInteger Avro.AvroDecimal.ToBigInteger ( AvroDecimal  value)
inlinestatic

Creates a BigInteger from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A BigInteger.

◆ ToBoolean()

bool IConvertible. Avro.AvroDecimal.ToBoolean ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a boolean.

Parameters
providerThe format provider.
Returns
true or false, which reflects the value of the current AvroDecimal.

◆ ToByte() [1/2]

static byte Avro.AvroDecimal.ToByte ( AvroDecimal  value)
inlinestatic

Creates a byte from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A byte.

◆ ToByte() [2/2]

byte IConvertible. Avro.AvroDecimal.ToByte ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a byte.

Parameters
providerThe format provider.
Returns
A byte.

◆ ToChar()

char IConvertible. Avro.AvroDecimal.ToChar ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a char.

Parameters
providerThe format provider.
Returns
This method always throws an InvalidCastException.

◆ ToDateTime()

DateTime IConvertible. Avro.AvroDecimal.ToDateTime ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a DateTime.

Parameters
providerThe format provider.
Returns
This method always throws an InvalidCastException.

◆ ToDecimal() [1/2]

static decimal Avro.AvroDecimal.ToDecimal ( AvroDecimal  value)
inlinestatic

Creates a decimal from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A decimal.

◆ ToDecimal() [2/2]

decimal IConvertible. Avro.AvroDecimal.ToDecimal ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a decimal.

Parameters
providerThe format provider.
Returns
A decimal.

◆ ToDouble() [1/2]

static double Avro.AvroDecimal.ToDouble ( AvroDecimal  value)
inlinestatic

Creates a double from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A double.

◆ ToDouble() [2/2]

double IConvertible. Avro.AvroDecimal.ToDouble ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a double.

Parameters
providerThe format provider.
Returns
A double.

◆ ToInt16() [1/2]

static short Avro.AvroDecimal.ToInt16 ( AvroDecimal  value)
inlinestatic

Creates a short from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A short.

◆ ToInt16() [2/2]

short IConvertible. Avro.AvroDecimal.ToInt16 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a short.

Parameters
providerThe format provider.
Returns
A short.

◆ ToInt32() [1/2]

static int Avro.AvroDecimal.ToInt32 ( AvroDecimal  value)
inlinestatic

Creates an int from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
An int.

◆ ToInt32() [2/2]

int IConvertible. Avro.AvroDecimal.ToInt32 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to an int.

Parameters
providerThe format provider.
Returns
An int.

◆ ToInt64() [1/2]

static long Avro.AvroDecimal.ToInt64 ( AvroDecimal  value)
inlinestatic

Creates a long from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A long.

◆ ToInt64() [2/2]

long IConvertible. Avro.AvroDecimal.ToInt64 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a long.

Parameters
providerThe format provider.
Returns
A long.

◆ ToSByte() [1/2]

static sbyte Avro.AvroDecimal.ToSByte ( AvroDecimal  value)
inlinestatic

Creates a signed byte from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A signed byte.

◆ ToSByte() [2/2]

sbyte IConvertible. Avro.AvroDecimal.ToSByte ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a signed byte.

Parameters
providerThe format provider.
Returns
A signed byte.

◆ ToSingle() [1/2]

static float Avro.AvroDecimal.ToSingle ( AvroDecimal  value)
inlinestatic

Creates a double from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
A double.

◆ ToSingle() [2/2]

float IConvertible. Avro.AvroDecimal.ToSingle ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a float.

Parameters
providerThe format provider.
Returns
A float.

◆ ToString() [1/3]

override string Avro.AvroDecimal.ToString ( )
inline

Converts the current AvroDecimal to a string.

Returns
A string representation of the numeric value.

◆ ToString() [2/3]

string IConvertible. Avro.AvroDecimal.ToString ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to a string.

Parameters
providerThe format provider.
Returns
A string.

◆ ToString() [3/3]

string Avro.AvroDecimal.ToString ( string  format,
IFormatProvider  formatProvider 
)
inline

Converts the current AvroDecimal to a string.

Parameters
format
formatProviderThe format provider.
Returns
A string representation of the numeric value.

◆ ToType()

object IConvertible. Avro.AvroDecimal.ToType ( Type  conversionType,
IFormatProvider  provider 
)
inline

Converts the numeric value of the current AvroDecimal to a given type.

Parameters
conversionTypeThe type to which the value of the current AvroDecimal should be converted.
providerAn System.IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns

◆ ToType< T >()

T Avro.AvroDecimal.ToType< T > ( )
inline

Converts the numeric value of the current AvroDecimal to a given type.

Template Parameters
TThe type to which the value of the current AvroDecimal should be converted.
Returns
A value of type T converted from the current AvroDecimal.
Type Constraints
T :struct 

◆ ToUInt16() [1/2]

static ushort Avro.AvroDecimal.ToUInt16 ( AvroDecimal  value)
inlinestatic

Creates an unsigned short from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
An unsigned short.

◆ ToUInt16() [2/2]

ushort IConvertible. Avro.AvroDecimal.ToUInt16 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to an unsigned short.

Parameters
providerThe format provider.
Returns
An unsigned short.

◆ ToUInt32() [1/2]

static uint Avro.AvroDecimal.ToUInt32 ( AvroDecimal  value)
inlinestatic

Creates an unsigned int from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
An unsigned int.

◆ ToUInt32() [2/2]

uint IConvertible. Avro.AvroDecimal.ToUInt32 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to an unsigned int.

Parameters
providerThe format provider.
Returns
An unsigned int.

◆ ToUInt64() [1/2]

static ulong Avro.AvroDecimal.ToUInt64 ( AvroDecimal  value)
inlinestatic

Creates an unsigned long from a given AvroDecimal.

Parameters
valueThe AvroDecimal.
Returns
An unsigned long.

◆ ToUInt64() [2/2]

ulong IConvertible. Avro.AvroDecimal.ToUInt64 ( IFormatProvider  provider)
inline

Converts the current AvroDecimal to an unsigned long.

Parameters
providerThe format provider.
Returns
An unsigned long.

Property Documentation

◆ Scale

int Avro.AvroDecimal.Scale
get

Gets the scale of the current AvroDecimal.

◆ UnscaledValue

BigInteger Avro.AvroDecimal.UnscaledValue
get

Gets the unscaled integer value represented by the current AvroDecimal.


The documentation for this struct was generated from the following file: