Precondition

Description

static class CodeX.Precondition

Common precondition checks for method arguments.

Public / Methods

Empty


[Pure]
public static method Empty → (1)

str in : string

The string.

returns → bool

true if the string is empty, false if not.

Is the given string empty, i.e. it is null or has a length of 0?

Not​Power​Of​Two

2 overloads


[Pure]
public static method NotPowerOfTwo1 → (1)

number in : int32

The number.

returns → bool

true if number in is not a power of two, false if it is.

Is the given number not a power of two?


[Pure]
public static method NotPowerOfTwo2 → (1)

number in : int64

The number.

returns → bool

true if number in is not a power of two, false if it is.

Is the given number not a power of two?

Not​Power​Of​Two​Plus​One

2 overloads


[Pure]
public static method NotPowerOfTwoPlusOne1 → (1)

number in : int32

The number.

returns → bool

true if number in is not a power of two plus one, false if it is.

Is the given number not a power of two plus one?


[Pure]
public static method NotPowerOfTwoPlusOne2 → (1)

number in : int64

The number.

returns → bool

true if number in is not a power of two plus one, false if it is.

Is the given number not a power of two plus one?

Not​Within​Interval

4 overloads


[Pure]
public static method NotWithinInterval1 → (3)

value in : int32

The value.

minimum in : int32

The lower interval bound (inclusive).

maximum in : int32

The upper interval bound (inclusive).

returns → bool

true if value in is outside of the interval, false if it is inside of it.

Is the given value outside of the specified interval?


[Pure]
public static method NotWithinInterval2 → (3)

value in : int64

The value.

minimum in : int64

The lower interval bound (inclusive).

maximum in : int64

The upper interval bound (inclusive).

returns → bool

true if value in is outside of the interval, false if it is inside of it.

Is the given value outside of the specified interval?


[Pure]
public static method NotWithinInterval3 → (3)

value in : float32

The value.

minimum in : float32

The lower interval bound (inclusive).

maximum in : float32

The upper interval bound (inclusive).

returns → bool

true if value in is outside of the interval, false if it is inside of it.

Is the given value outside of the specified interval?


[Pure]
public static method NotWithinInterval4 → (3)

value in : float64

The value.

minimum in : float64

The lower interval bound (inclusive).

maximum in : float64

The upper interval bound (inclusive).

returns → bool

true if value in is outside of the interval, false if it is inside of it.

Is the given value outside of the specified interval?