C# Class Sharith.MathUtils.PositiveRange

a PositiveRange is an interval of integers, given by a lower bound Min and an upper bound Max, such that 0 <= Min and Min <= Max. a PositiveRange is immutable.
Inheritance: ICloneable
Afficher le fichier Open project: PeterLuschny/Fast-Factorial-Functions Class Usage Examples

Méthodes publiques

Свойство Type Description
Max int
Min int

Méthodes publiques

Méthode Description
Clone ( ) : object

Overrides System.Object.Clone()

Contains ( PositiveRange range ) : bool

Checks if the given range is a subrange, bo.exp. this.Min <= range.Min and range.Max <= this.Max.

Contains ( int value ) : bool

Checks if the given value lies within the range, i.e. Min <= value and value <= Max.

ContainsOrFail ( PositiveRange range ) : bool

Checks if the given range is a subrange, bo.exp. this.Min <= range.Min and range.Max <= this.Max. If the range ist not contained an ArgumentOutOfRangeException will be raised.

ContainsOrFail ( int value ) : bool

Checks if the given value lies within the range, bo.exp. Min <= value and value <= Max. If the value ist not contained an ArgumentOutOfRangeException will be raised.

Equals ( PositiveRange that ) : bool

Compares this range to the specified range. The results is true if and only if the argument has the same values as this object.

Equals ( object obj ) : bool

Compares this range to the specified object. The results is true if and only if the argument is not null and is a PositiveRange object that has the same values as this object.

GetHashCode ( ) : int

a hash code value for this range.

PositiveRange ( int low, int high ) : System

Initializes a new instance of the PositiveRange class, i.e. a range of integers, such that 0 <= low <= high.

Size ( ) : int

The Size of the range.

ToString ( ) : string

Represents the range as a string, formatted as "[Min,Max]".

operator ( ) : bool

Compares this range to the specified range. The results is true if and only if the arguments do not have the same value.

Method Details

Clone() public méthode

Overrides System.Object.Clone()
public Clone ( ) : object
Résultat object

Contains() public méthode

Checks if the given range is a subrange, bo.exp. this.Min <= range.Min and range.Max <= this.Max.
public Contains ( PositiveRange range ) : bool
range PositiveRange The range to be checked.
Résultat bool

Contains() public méthode

Checks if the given value lies within the range, i.e. Min <= value and value <= Max.
public Contains ( int value ) : bool
value int The value to checked.
Résultat bool

ContainsOrFail() public méthode

Checks if the given range is a subrange, bo.exp. this.Min <= range.Min and range.Max <= this.Max. If the range ist not contained an ArgumentOutOfRangeException will be raised.
public ContainsOrFail ( PositiveRange range ) : bool
range PositiveRange The range to be checked.
Résultat bool

ContainsOrFail() public méthode

Checks if the given value lies within the range, bo.exp. Min <= value and value <= Max. If the value ist not contained an ArgumentOutOfRangeException will be raised.
public ContainsOrFail ( int value ) : bool
value int The value to checked.
Résultat bool

Equals() public méthode

Compares this range to the specified range. The results is true if and only if the argument has the same values as this object.
public Equals ( PositiveRange that ) : bool
that PositiveRange a positive range to compare with.
Résultat bool

Equals() public méthode

Compares this range to the specified object. The results is true if and only if the argument is not null and is a PositiveRange object that has the same values as this object.
public Equals ( object obj ) : bool
obj object The object to compare with.
Résultat bool

GetHashCode() public méthode

a hash code value for this range.
public GetHashCode ( ) : int
Résultat int

PositiveRange() public méthode

Initializes a new instance of the PositiveRange class, i.e. a range of integers, such that 0 <= low <= high.
public PositiveRange ( int low, int high ) : System
low int The lower bound (Min) of the range.
high int The upper bound (Max) of the range.
Résultat System

Size() public méthode

The Size of the range.
public Size ( ) : int
Résultat int

ToString() public méthode

Represents the range as a string, formatted as "[Min,Max]".
public ToString ( ) : string
Résultat string

operator() public static méthode

Compares this range to the specified range. The results is true if and only if the arguments do not have the same value.
public static operator ( ) : bool
Résultat bool

Property Details

Max public_oe property

Gets upper bound (Max) of the interval.
public int Max
Résultat int

Min public_oe property

Gets the lower bound (Min) of the interval.
public int Min
Résultat int