Class ParsedExpressionBoundArguments<TArg>
- Namespace
- LfrlAnvil.Computable.Expressions
- Assembly
- LfrlAnvil.Computable.Expressions.dll
Represents a collection of named bound arguments of IParsedExpression<TArg, TResult>.
public sealed class ParsedExpressionBoundArguments<TArg> : IReadOnlyCollection<KeyValuePair<StringSegment, TArg?>>, IEnumerable<KeyValuePair<StringSegment, TArg?>>, IEnumerable
Type Parameters
TArg
- Inheritance
-
ParsedExpressionBoundArguments<TArg>
- Implements
- Inherited Members
Constructors
ParsedExpressionBoundArguments(IEnumerable<KeyValuePair<StringSegment, TArg?>>)
Creates a new ParsedExpressionBoundArguments<TArg> instance.
public ParsedExpressionBoundArguments(IEnumerable<KeyValuePair<StringSegment, TArg?>> map)
Parameters
map
IEnumerable<KeyValuePair<StringSegment, TArg>>Source collection.
Fields
Empty
Represents an empty collection of named bound arguments.
public static readonly ParsedExpressionBoundArguments<TArg> Empty
Field Value
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
Methods
Contains(StringSegment)
Checks whether or not this collection contains an argument with the specified name
.
[Pure]
public bool Contains(StringSegment name)
Parameters
name
StringSegmentName to check.
Returns
- bool
true when an argument exists, otherwise false.
GetEnumerator()
Returns an enumerator that iterates through the collection.
[Pure]
public IEnumerator<KeyValuePair<StringSegment, TArg?>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<StringSegment, TArg>>
An enumerator that can be used to iterate through the collection.
TryGetValue(StringSegment, out TArg?)
Attempts to return a value associated with an argument with the specified name
.
[Pure]
public bool TryGetValue(StringSegment name, out TArg? result)
Parameters
name
StringSegmentArgument name.
result
TArgout parameter that returns a value associated with the provided argument.
Returns
- bool
true when an argument exists, otherwise false.