Classes Files

Wombat::NullableInt

Modelled after Nullable in C# 2.0

Inherits from IComparable

Public Functions

  Name
  NullableInt(int value)
Constructor
int GetValueOrDefault()
Get the value
int GetValueOrDefault(int defaultValue)
Get value, or default if value is not defined
override bool Equals(object other)
Test for equality
int CompareTo(object obj)
Compare another object
override int GetHashCode()
Return the hashcode
override string ToString()
Stringify the value
implicit operator NullableInt(int value)
Conversion from int
static operator int(NullableInt value)
Conversion to int

Public Properties

  Name
bool HasValue
Return TRUE if object has a value
int Value
Return the value

Public Functions Documentation

function NullableInt

NullableInt(
    int value
)

Constructor

function GetValueOrDefault

int GetValueOrDefault()

Get the value

Get the value

function GetValueOrDefault

int GetValueOrDefault(
    int defaultValue
)

Get value, or default if value is not defined

function Equals

override bool Equals(
    object other
)

Test for equality

Parameters:

  • other Object to compare with

Return: TRUE if other object is equal to this one, FALSE otherwise

function CompareTo

int CompareTo(
    object obj
)

Compare another object

Parameters:

  • obj Object to compare with

Return: If both objects are the same, returns zero. If this object has a value but the other object does not, returns +1. If this object does not have a value, but the other object does have a value, returns -1. If both objects have a value, returns an indication of their relative values /returns>

function GetHashCode

override int GetHashCode()

Return the hashcode

function ToString

override string ToString()

Stringify the value

function operator NullableInt

static implicit operator NullableInt(
    int value
)

Conversion from int

function operator int

static explicit static operator int(
    NullableInt value
)

Conversion to int

Public Property Documentation

property HasValue

bool HasValue;

Return TRUE if object has a value

property Value

int Value;

Return the value


Updated on 2023-03-31 at 15:29:33 +0100