Search Results for

    Show / Hide Table of Contents

    Struct RealmInteger<T>

    A structure representing an integer value in the database. It offers API to increment the value, which produces correct merges during conflicts.

    Implements
    IEquatable<T>
    IComparable<RealmInteger<T>>
    IComparable<T>
    IConvertible
    IFormattable
    Namespace: Realms
    Assembly: Realm.dll
    Syntax
    public readonly struct RealmInteger<T> : IEquatable<T>, IComparable<RealmInteger<T>>, IComparable<T>, IConvertible, IFormattable where T : struct, IComparable<T>, IFormattable, IConvertible, IEquatable<T>
    Type Parameters
    Name Description
    T

    The integer type, represented by this RealmInteger<T>. Supported types are byte, short, int, and long.

    Remarks

    RealmInteger<T> is implicitly convertible to and from T/>.
    Calling Increment() on a managed RealmObject/EmbeddedObject's property must be done in a write transaction. When calling Increment() on a RealmObject/EmbeddedObject property, it will increment the property's value in the database, so the change will be reflected the next time this property is accessed.

    Methods

    | Edit this page View Source

    CompareTo(RealmInteger<T>)

    Compares this instance to another RealmInteger<T> value.

    Declaration
    public int CompareTo(RealmInteger<T> other)
    Parameters
    Type Name Description
    RealmInteger<T> other

    The value to compare to.

    Returns
    Type Description
    int

    1 if this instance is greater than other, 0 if the two values are equal, and -1 if other is larger.

    | Edit this page View Source

    CompareTo(T)

    Compares this instance to another numeric value.

    Declaration
    public int CompareTo(T other)
    Parameters
    Type Name Description
    T other

    The value to compare to.

    Returns
    Type Description
    int

    1 if this instance is greater than other, 0 if the two values are equal, and -1 if other is larger.

    | Edit this page View Source

    Decrement()

    Decrements the integer value by 1. Inverse of Increment().

    Declaration
    public RealmInteger<T> Decrement()
    Returns
    Type Description
    RealmInteger<T>

    The decremented value.

    | Edit this page View Source

    Equals(T)

    Indicates whether this instance represents the same numeric value as the provided object.

    Declaration
    public bool Equals(T other)
    Parameters
    Type Name Description
    T other

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance represent the same numeric value; otherwise, false.

    | Edit this page View Source

    Increment()

    Increments the integer value by 1. Inverse of Decrement().

    Declaration
    public RealmInteger<T> Increment()
    Returns
    Type Description
    RealmInteger<T>

    The incremented value.

    | Edit this page View Source

    Increment(T)

    Increment the integer value by a specified amount.

    Declaration
    public RealmInteger<T> Increment(T value)
    Parameters
    Type Name Description
    T value

    Value by which to increment.

    Returns
    Type Description
    RealmInteger<T>

    The incremented value.

    | Edit this page View Source

    ToString()

    Returns the string representation of the underlying numeric value.

    Declaration
    public override string? ToString()
    Returns
    Type Description
    string

    The string representation of the numeric value.

    Overrides
    ValueType.ToString()
    | Edit this page View Source

    ToString(string?, IFormatProvider?)

    Formats the value of the current instance using the specified format.

    Declaration
    public string ToString(string? format, IFormatProvider? formatProvider)
    Parameters
    Type Name Description
    string format

    The format to use. -or- A null reference to use the default format defined for the type of the IFormattable implementation.

    IFormatProvider formatProvider

    The provider to use to format the value. -or- A null reference to obtain the numeric format information from the current locale setting of the operating system.

    Returns
    Type Description
    string

    The value of the current instance in the specified format.

    Operators

    | Edit this page View Source

    operator --(RealmInteger<T>)

    Decrements the value of the integer by 1. Equivalent to calling Decrement().

    Declaration
    public static RealmInteger<T> operator --(RealmInteger<T> source)
    Parameters
    Type Name Description
    RealmInteger<T> source

    The RealmInteger<T> that will be decremented.

    Returns
    Type Description
    RealmInteger<T>

    The decremented value.

    | Edit this page View Source

    operator ==(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> instances for equality.

    Declaration
    public static bool operator ==(RealmInteger<T> first, RealmInteger<T> second)
    Parameters
    Type Name Description
    RealmInteger<T> first

    The first RealmInteger<T>.

    RealmInteger<T> second

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if their underlying values are equal; false otherwise.

    | Edit this page View Source

    operator >(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> values.

    Declaration
    public static bool operator >(RealmInteger<T> left, RealmInteger<T> right)
    Parameters
    Type Name Description
    RealmInteger<T> left

    The first RealmInteger<T>.

    RealmInteger<T> right

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if left is greater than right.

    | Edit this page View Source

    operator >=(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> values.

    Declaration
    public static bool operator >=(RealmInteger<T> left, RealmInteger<T> right)
    Parameters
    Type Name Description
    RealmInteger<T> left

    The first RealmInteger<T>.

    RealmInteger<T> right

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if left is greater than or equal to right.

    | Edit this page View Source

    implicit operator T(RealmInteger<T>)

    Converts a RealmInteger<T> to its underlying value.

    Declaration
    public static implicit operator T(RealmInteger<T> i)
    Parameters
    Type Name Description
    RealmInteger<T> i

    The RealmInteger<T>.

    Returns
    Type Description
    T
    | Edit this page View Source

    implicit operator RealmInteger<T>(T)

    Constructs a RealmInteger<T> from its underlying value.

    Declaration
    public static implicit operator RealmInteger<T>(T i)
    Parameters
    Type Name Description
    T i

    The value.

    Returns
    Type Description
    RealmInteger<T>
    | Edit this page View Source

    operator ++(RealmInteger<T>)

    Increments the value of the integer by 1. Equivalent to calling Increment().

    Declaration
    public static RealmInteger<T> operator ++(RealmInteger<T> source)
    Parameters
    Type Name Description
    RealmInteger<T> source

    The RealmInteger<T> that will be incremented.

    Returns
    Type Description
    RealmInteger<T>

    The incremented value.

    | Edit this page View Source

    operator !=(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> instances for inequality.

    Declaration
    public static bool operator !=(RealmInteger<T> first, RealmInteger<T> second)
    Parameters
    Type Name Description
    RealmInteger<T> first

    The first RealmInteger<T>.

    RealmInteger<T> second

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if their underlying values are equal; false otherwise.

    | Edit this page View Source

    operator <(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> values.

    Declaration
    public static bool operator <(RealmInteger<T> left, RealmInteger<T> right)
    Parameters
    Type Name Description
    RealmInteger<T> left

    The first RealmInteger<T>.

    RealmInteger<T> right

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if left is less than right.

    | Edit this page View Source

    operator <=(RealmInteger<T>, RealmInteger<T>)

    Compares two RealmInteger<T> values.

    Declaration
    public static bool operator <=(RealmInteger<T> left, RealmInteger<T> right)
    Parameters
    Type Name Description
    RealmInteger<T> left

    The first RealmInteger<T>.

    RealmInteger<T> right

    The second RealmInteger<T>.

    Returns
    Type Description
    bool

    true if left is less than or equal to right.

    Implements

    IEquatable<T>
    IComparable<T>
    IComparable<T>
    IConvertible
    IFormattable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2020-2024 Realm
    Generated by DocFX