-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Ranges_CompositeRangeExtensions_ToCompositeRangeTo__3
Andrew Koryavchenko edited this page Jun 17, 2018
·
2 revisions
CompositeRangeExtensions.ToCompositeRangeTo(TSource, T, TKey) Method (IEnumerable(TSource), Func(TSource, T), Func(TSource, TKey))
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
C#
public static CompositeRange<T, TKey> ToCompositeRangeTo<TSource, T, TKey>(
this IEnumerable<TSource> source,
Func<TSource, T> toValueSelector,
Func<TSource, TKey> keySelector
)
VB
<ExtensionAttribute>
Public Shared Function ToCompositeRangeTo(Of TSource, T, TKey) (
source As IEnumerable(Of TSource),
toValueSelector As Func(Of TSource, T),
keySelector As Func(Of TSource, TKey)
) As CompositeRange(Of T, TKey)
F#
[<ExtensionAttribute>]
static member ToCompositeRangeTo :
source : IEnumerable<'TSource> *
toValueSelector : Func<'TSource, 'T> *
keySelector : Func<'TSource, 'TKey> -> CompositeRange<'T, 'TKey>
- source
- Type: System.Collections.Generic.IEnumerable(TSource)
Original collection. - toValueSelector
- Type: System.Func(TSource, T)
Callback to obtain a value for the To boundary. - keySelector
- Type: System.Func(TSource, TKey)
Callback to obtain a value for the range key.
- TSource
- The type of the values in original collection.
- T
- The type of the range values.
- TKey
- The type of the range key
Type: CompositeRange(T, TKey)
A new composite range with keys filled from the original collection.
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).
CompositeRangeExtensions Class
ToCompositeRangeTo Overload
CodeJam.Ranges Namespace