Show / Hide Table of Contents

Struct Range<T>

Define un rango de valores.

Implements
IRange<T>
IEquatable<IRange<T>>
ICloneable<Range<T>>
ICloneable
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public struct Range<T> : IRange<T>, IEquatable<IRange<T>>, ICloneable<Range<T>>, ICloneable where T : IComparable<T>
Type Parameters
Name Description
T

Tipo base del rango de valores.

Constructors

| Edit this page View Source

Range(T)

Inicializa una nueva instancia de la estructura Range<T>

Declaration
public Range(T maximum)
Parameters
Type Name Description
T maximum

Valor máximo del rango, inclusive.

| Edit this page View Source

Range(T, bool)

Inicializa una nueva instancia de la estructura Range<T>

Declaration
public Range(T maximum, bool inclusive)
Parameters
Type Name Description
T maximum

Valor máximo del rango.

bool inclusive

Si se establece en true, el valor máximo será incluido dentro del rango.

| Edit this page View Source

Range(T, T)

Inicializa una nueva instancia de la estructura Range<T>

Declaration
public Range(T minimum, T maximum)
Parameters
Type Name Description
T minimum

Valor mínimo del rango, inclusive.

T maximum

Valor máximo del rango, inclusive.

| Edit this page View Source

Range(T, T, bool)

Inicializa una nueva instancia de la estructura Range<T>

Declaration
public Range(T minimum, T maximum, bool inclusive)
Parameters
Type Name Description
T minimum

Valor mínimo del rango.

T maximum

Valor máximo del rango.

bool inclusive

Si se establece en true, los valores mínimo y máximo serán incluidos dentro del rango.

| Edit this page View Source

Range(T, T, bool, bool)

Inicializa una nueva instancia de la estructura Range<T>

Declaration
public Range(T minimum, T maximum, bool minInclusive, bool maxInclusive)
Parameters
Type Name Description
T minimum

Valor mínimo del rango.

T maximum

Valor máximo del rango.

bool minInclusive

Si se establece en true, el valor mínimo será incluido dentro del rango.

bool maxInclusive

Si se establece en true, el valor máximo será incluido dentro del rango.

Properties

| Edit this page View Source

MaxInclusive

Obtiene o establece un valor que determina si el valor máximo es parte del rango.

Declaration
public bool MaxInclusive { readonly get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Maximum

Valor máximo del rango.

Declaration
public T Maximum { readonly get; set; }
Property Value
Type Description
T
| Edit this page View Source

MinInclusive

Obtiene o establece un valor que determina si el valor mínimo es parte del rango.

Declaration
public bool MinInclusive { readonly get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Minimum

Valor mínimo del rango.

Declaration
public T Minimum { readonly get; set; }
Property Value
Type Description
T

Methods

| Edit this page View Source

Clone()

Creates a copy of this instance.

Declaration
public readonly Range<T> Clone()
Returns
Type Description
Range<T>

A copy of this instance of type Range<T>.

| Edit this page View Source

Equals(object?)

Indica si esta instancia y un objeto especificado son iguales.

Declaration
public override readonly bool Equals(object? obj)
Parameters
Type Name Description
object obj

Objeto que se va a compara con la instancia actual.

Returns
Type Description
bool

true si esta instancia y obj son iguales, false en caso contrario.

Overrides
ValueType.Equals(object)
| Edit this page View Source

Equals(IRange<T>?)

Indica si esta instancia y un objeto especificado son iguales.

Declaration
public readonly bool Equals(IRange<T>? other)
Parameters
Type Name Description
IRange<T> other

Objeto que se va a compara con la instancia actual.

Returns
Type Description
bool

true si esta instancia y other son iguales, false en caso contrario.

| Edit this page View Source

GetHashCode()

Devuelve el código Hash de esta instancia.

Declaration
public override readonly int GetHashCode()
Returns
Type Description
int

El código Hash de esta instancia.

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

Intersect(IRange<T>)

Obtiene un rango de intersección a partir de este y otro rango especificado.

Declaration
public readonly Range<T> Intersect(IRange<T> other)
Parameters
Type Name Description
IRange<T> other

Rango a intersectar.

Returns
Type Description
Range<T>

La intersección entre este rango y other.

| Edit this page View Source

Intersects(IRange<T>)

Determina si un Range<T> intersecta a este.

Declaration
public readonly bool Intersects(IRange<T> other)
Parameters
Type Name Description
IRange<T> other

Rango a comprobar.

Returns
Type Description
bool

true si other intersecta a este Range<T>, false en caso contrario.

| Edit this page View Source

IsWithin(T)

Comprueba si un valor T se encuentra dentro de este Range<T>.

Declaration
public readonly bool IsWithin(T value)
Parameters
Type Name Description
T value

Valor a comprobar.

Returns
Type Description
bool

true si el valor se encuentra dentro de este Range<T>, false en caso contrario.

| Edit this page View Source

Join(IRange<T>)

Combina este Range<T> con otro.

Declaration
public readonly Range<T> Join(IRange<T> other)
Parameters
Type Name Description
IRange<T> other
Returns
Type Description
Range<T>
| Edit this page View Source

Parse(string)

Crea un Range<T> a partir de una cadena.

Declaration
public static Range<T> Parse(string value)
Parameters
Type Name Description
string value

Valor a partir del cual crear un Range<T>.

Returns
Type Description
Range<T>

Range<T> que ha sido creado.

Exceptions
Type Condition
FormatException

Se produce si la conversión ha fallado.

| Edit this page View Source

ToString()

Convierte este Range<T> en su representación como una cadena.

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

Una representación de este Range<T> como una cadena.

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

TryParse(string, out Range<T>)

Intenta crear un Range<T> a partir de una cadena.

Declaration
public static bool TryParse(string value, out Range<T> range)
Parameters
Type Name Description
string value

Valor a partir del cual crear un Range<T>.

Range<T> range

Range<T> que ha sido creado.

Returns
Type Description
bool

true si la conversión ha tenido éxito, false en caso contrario.

Operators

| Edit this page View Source

operator +(Range<T>, Range<T>)

Une dos rangos de valores.

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

Operador de la izquierda.

Range<T> right

Operador de la derecha.

Returns
Type Description
Range<T>

La unión de ambos Range<T>. Si los rangos no intersectan, se incluirán todos los valores faltantes.

| Edit this page View Source

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

Compara la igualdad entre dos instancias de Range<T>.

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

Objeto a comparar

Range<T> right

Objeto contra el cual comparar.

Returns
Type Description
bool

true si ambas instancias son iguales, false en caso contrario.

| Edit this page View Source

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

Compara dos instancias de Range<T>, y devuelve true si son distintas la una de la otra.

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

Objeto a comparar

Range<T> right

Objeto contra el cual comparar.

Returns
Type Description
bool

true si ambas instancias son distintas, false en caso contrario.

Implements

IRange<T>
IEquatable<T>
ICloneable<T>
ICloneable

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Objects.Itself<T>(T)
Objects.ShallowClone<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX