Skip to content

M_CodeJam_Ranges_CompositeRangeExtensions_ToCompositeRangeTo__2

Andrew Koryavchenko edited this page Jun 17, 2018 · 2 revisions

CompositeRangeExtensions.ToCompositeRangeTo(TSource, T) Method (IEnumerable(TSource), Func(TSource, T))

Converts sequence of elements to the composite range using only To boundary. The From boundary value is taken from the previous item in sequence (-∞ for the last item in sequence).

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

Syntax

C#

public static CompositeRange<T, TSource> ToCompositeRangeTo<TSource, T>(
	this IEnumerable<TSource> source,
	Func<TSource, T> toValueSelector
)

VB

<ExtensionAttribute>
Public Shared Function ToCompositeRangeTo(Of TSource, T) ( 
	source As IEnumerable(Of TSource),
	toValueSelector As Func(Of TSource, T)
) As CompositeRange(Of T, TSource)

F#

[<ExtensionAttribute>]
static member ToCompositeRangeTo : 
        source : IEnumerable<'TSource> * 
        toValueSelector : Func<'TSource, 'T> -> CompositeRange<'T, 'TSource> 

Parameters

 

source
Type: System.Collections.Generic.IEnumerable(TSource)
Original collection.
toValueSelector
Type: System.Func(TSource, T)
Callback to obtain a value for the To boundary.

Type Parameters

 

TSource
The type of the values in original collection.
T
The type of the range values.

Return Value

Type: CompositeRange(T, TSource)
A new composite range with keys filled from the original collection.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(TSource). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

CompositeRangeExtensions Class
ToCompositeRangeTo Overload
CodeJam.Ranges Namespace

Clone this wiki locally