Class LeafCollection<TSource, TTarget>
Represents a collection of leaf rules.
Inheritance
Implements
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public sealed class LeafCollection<TSource, TTarget> : Object, IEnumerable<Leaf<TSource, TTarget>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TSource | Type of the source tree nodes. |
TTarget | Type of the target tree nodes. |
Properties
Count
Gets the number of leaf rules in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Add<TLeaf>(Expression<Func<TLeaf, TTarget>>, Int32)
Adds a new leaf rule.
Declaration
public void Add<TLeaf>(Expression<Func<TLeaf, TTarget>> convert, int cost)
where TLeaf : TSource
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TLeaf, TTarget>> | convert | Lambda expression representing the conversion from the source tree leaf node to the target tree node. |
System.Int32 | cost | Cost to apply the rule. |
Type Parameters
Name | Description |
---|---|
TLeaf | Type of the source tree leaf node. This type should be a subtype of TSource. |
Add<TLeaf>(Expression<Func<TLeaf, TTarget>>, Expression<Func<TLeaf, Boolean>>, Int32)
Adds a new leaf rule.
Declaration
public void Add<TLeaf>(Expression<Func<TLeaf, TTarget>> convert, Expression<Func<TLeaf, bool>> predicate, int cost)
where TLeaf : TSource
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TLeaf, TTarget>> | convert | Lambda expression representing the conversion from the source tree leaf node to the target tree node. |
System.Linq.Expressions.Expression<System.Func<TLeaf, System.Boolean>> | predicate | Lambda expression representing the predicate to apply to evaluate applicability of the rule to a source tree leaf node. |
System.Int32 | cost | Cost to apply the rule. |
Type Parameters
Name | Description |
---|---|
TLeaf | Type of the source tree leaf node. This type should be a subtype of TSource. |
GetEnumerator()
Gets an enumerator to iterate over the leaf rules in the collection.
Declaration
public IEnumerator<Leaf<TSource, TTarget>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Leaf<TSource, TTarget>> | Enumerator to iterate over the leaf rules in the collection. |