Skip to content

T_CodeJam_Ranges_Range_2

andrewvk edited this page Jul 1, 2016 · 4 revisions

Range(T, TKey) Structure

Describes a range of the values with a key attached.

Namespace: CodeJam.Ranges
Assembly: CodeJam (in CodeJam.dll) Version: 1.1.0.0 (1.1.0.0)

Syntax

C#

[SerializableAttribute]
public struct Range<T, TKey> : IRangeFactory<T, Range<T, TKey>>, 
	IRange<T>, IEquatable<Range<T, TKey>>, IFormattable

VB

<SerializableAttribute>
Public Structure Range(Of T, TKey)
	Implements IRangeFactory(Of T, Range(Of T, TKey)), 
	IRange(Of T), IEquatable(Of Range(Of T, TKey)), 
	IFormattable

F#

[<SealedAttribute>]
[<SerializableAttribute>]
type Range<'T, 'TKey> =  
    struct
        interface IRangeFactory<'T, Range<'T, 'TKey>>
        interface IRange<'T>
        interface IEquatable<Range<'T, 'TKey>>
        interface IFormattable
    end

Type Parameters

 

T
The type of the value. Should implement or .
TKey
The type of the range key
  The Range(T, TKey) type exposes the following members.

Constructors

 

Name Description
Public method Range(T, TKey)(T, T, TKey) Creates instance of
Public method Range(T, TKey)(RangeBoundaryFrom(T), RangeBoundaryTo(T), TKey) Creates instance of
  Back to Top

Properties

 

Name Description
Public property From Boundary From. Limits the values from the left.
Public property FromValue The value of Boundary From.
Public property IsEmpty The range is empty, ∅.
Public property IsInfinite The range is Infinite range (-∞..+∞).
Public property IsNotEmpty The range is NOT empty, ≠ ∅
Public property IsSinglePoint The range is Zero length range (the values of the boundary From and the boundary To are the same).
Public property Key The value associated with the range.
Public property To Boundary To. Limits the values from the right.
Public property ToValue The value of Boundary To.
  Back to Top

Methods

 

Name Description
Public method Equals(Object) Indicates whether the current range and a specified object are equal. (Overrides ValueType.Equals(Object).)
Public method Equals(Range(T, TKey)) Indicates whether the current range is equal to another.
Public method GetHashCode Returns a hash code for the current range. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ToString() Returns string representation of the range. (Overrides ValueType.ToString().)
Public method ToString(String) Returns string representation of the range using the specified format string. If T does not implement the format string is ignored.
Public method ToString(String, IFormatProvider) Returns string representation of the range using the specified format string. If T does not implement the format string is ignored.
  Back to Top

Operators

 

Name Description
Public operatorStatic member Equality Implements the operator ==.
Public operatorStatic member Inequality Implements the operator !=.
  Back to Top

See Also

Reference

CodeJam.Ranges Namespace
System.IComparable(T)
System.IComparable

Clone this wiki locally