Show / Hide Table of Contents

Class IEnumerableExtensions

Wrapper for extension methods on the IEnumerable interface.

Inheritance
Object
IEnumerableExtensions
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetTransformers.Extensions
Assembly: MetricSetTransformers.dll
Syntax
public static class IEnumerableExtensions

Methods

View Source

Add(IList<TokenOrExpression>, Expression)

Add a TokenOrExpression wrapping expression to tokenOrExpressions.

Declaration
public static void Add(this IList<TokenOrExpression> tokenOrExpressions, Expression expression)
Parameters
Type Name Description
IList<TokenOrExpression> tokenOrExpressions
Expression expression
View Source

Add(IList<TokenOrExpression>, String)

Add a TokenOrExpression wrapping token to tokenOrExpressions.

Declaration
public static void Add(this IList<TokenOrExpression> tokenOrExpressions, string token)
Parameters
Type Name Description
IList<TokenOrExpression> tokenOrExpressions
String token
View Source

AsSet<T>(IEnumerable<T>)

Set of unique items in a sequence.

Declaration
public static ISet<T> AsSet<T>(this IEnumerable<T> items)
Parameters
Type Name Description
IEnumerable<T> items
Returns
Type Description
ISet<T>
Type Parameters
Name Description
T
View Source

ClosureIn(Table, MetricsPlan)

Return the closure of table, along with all Expression nodes in plan which (in)directly depend on that closure.

Declaration
public static (ISet<Table>, ISet<Expression>) ClosureIn(this Table table, MetricsPlan plan)
Parameters
Type Name Description
Table table
MetricsPlan plan
Returns
Type Description
ValueTuple<ISet<Table>, ISet<Expression>>
View Source

ClosureIn(IEnumerable<Table>, MetricsPlan)

Return the closure of tables, along with all Expression nodes in plan which (in)directly depend on that closure.

Declaration
public static (ISet<Table>, ISet<Expression>) ClosureIn(this IEnumerable<Table> tables, MetricsPlan plan)
Parameters
Type Name Description
IEnumerable<Table> tables
MetricsPlan plan
Returns
Type Description
ValueTuple<ISet<Table>, ISet<Expression>>
View Source

ExpressionNameLookup(IEnumerable<Expression>, Boolean)

Create a dictionary mapping expression "name" to the "best" (lives in the highest Table node) candidate for an Expression object with that name. Use avoidAggregations to determine whether to use or avoid the candidate in Aggregation nodes.

Declaration
public static IReadOnlyDictionary<string, ColumnReference> ExpressionNameLookup(this IEnumerable<Expression> expressions, bool avoidAggregations = true)
Parameters
Type Name Description
IEnumerable<Expression> expressions
Boolean avoidAggregations
Returns
Type Description
IReadOnlyDictionary<String, ColumnReference>
View Source

ExpressionsInTableLookup<T>(IEnumerable<T>)

Declaration
public static IDictionary<Table, ISet<T>> ExpressionsInTableLookup<T>(this IEnumerable<T> expressions)
    where T : Expression
Parameters
Type Name Description
IEnumerable<T> expressions
Returns
Type Description
IDictionary<Table, ISet<T>>
Type Parameters
Name Description
T
View Source

MaxBy<T>(IEnumerable<T>, Func<T, Double>)

Return the element of items for which selector has maximum value.

Declaration
public static T MaxBy<T>(this IEnumerable<T> items, Func<T, double> selector)
Parameters
Type Name Description
IEnumerable<T> items
Func<T, Double> selector
Returns
Type Description
T
Type Parameters
Name Description
T
Remarks

Inspired by (but not a clone of) the MoreLINQ.MaxBy function: https://github.com/morelinq/MoreLINQ/blob/master/MoreLinq/MaxBy.cs

View Source

TopColumnReferences(IEnumerable<Expression>)

Determines whether a ColumnReference is "top", i.e. such that no other ColumnReference within the same table depends on it.

Declaration
public static ISet<ColumnReference> TopColumnReferences(this IEnumerable<Expression> expressions)
Parameters
Type Name Description
IEnumerable<Expression> expressions
Returns
Type Description
ISet<ColumnReference>
Remarks

We need to provide a full list of expressions in the plan because "being a top column reference" is a global property.

  • View Source
Back to top Generated by DocFX