Struct ReadOnlyCollectionView<I, O>
Represents lazily converted read-only collection.
Namespace: DotNext.Collections.Generic
Assembly: DotNext.dll
Syntax
public struct ReadOnlyCollectionView<I, O> : IReadOnlyCollection<O>, IEquatable<ReadOnlyCollectionView<I, O>>
Type Parameters
Name | Description |
---|---|
I | Type of items in the source collection. |
O | Type of items in the converted collection. |
Constructors
| Improve this Doc View SourceReadOnlyCollectionView(IReadOnlyCollection<I>, ValueFunc<I, O>)
Initializes a new lazily converted view.
Declaration
public ReadOnlyCollectionView(IReadOnlyCollection<I> collection, in ValueFunc<I, O> mapper)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<I> | collection | Read-only collection to convert. |
ValueFunc<I, O> | mapper | Collection items converter. |
Properties
| Improve this Doc View SourceCount
Count of items in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceEquals(ReadOnlyCollectionView<I, O>)
Determines whether two converted collections are same.
Declaration
public bool Equals(ReadOnlyCollectionView<I, O> other)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyCollectionView<I, O> | other | Other collection to compare. |
Returns
Type | Description |
---|---|
Boolean | true if this view wraps the same source collection and contains the same converter as other view; otherwise, false. |
Equals(Object)
Determines whether two converted collections are same.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
Object | other | Other collection to compare. |
Returns
Type | Description |
---|---|
Boolean | true if this view wraps the same source collection and contains the same converter as other view; otherwise, false. |
GetEnumerator()
Returns enumerator over converted items.
Declaration
public IEnumerator<O> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<O> | The enumerator over converted items. |
GetHashCode()
Returns hash code for the this view.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code of this view. |
Operators
| Improve this Doc View SourceEquality(ReadOnlyCollectionView<I, O>, ReadOnlyCollectionView<I, O>)
Determines whether two collections are same.
Declaration
public static bool operator ==(ReadOnlyCollectionView<I, O> first, ReadOnlyCollectionView<I, O> second)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyCollectionView<I, O> | first | The first collection to compare. |
ReadOnlyCollectionView<I, O> | second | The second collection to compare. |
Returns
Type | Description |
---|---|
Boolean | true if the first view wraps the same source collection and contains the same converter as the second view; otherwise, false. |
Inequality(ReadOnlyCollectionView<I, O>, ReadOnlyCollectionView<I, O>)
Determines whether two collections are not same.
Declaration
public static bool operator !=(ReadOnlyCollectionView<I, O> first, ReadOnlyCollectionView<I, O> second)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyCollectionView<I, O> | first | The first collection to compare. |
ReadOnlyCollectionView<I, O> | second | The second collection to compare. |
Returns
Type | Description |
---|---|
Boolean | true if the first view wraps the different source collection and contains the different converter as the second view; otherwise, false. |