Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class MergedEnumerator<T>

    Provides a merged sorted view from several sorted iterators.

    If built with removeDuplicates set to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.

    If built with removeDuplicates set to false then all elements in all iterators are returned.

    Caveats:
    • The behavior is undefined if the iterators are not actually sorted.
    • Null elements are unsupported.
    • If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
    • When elements are deduplicated it is not defined which one is returned.
    • If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.

    The caller is responsible for disposing the IEnumerator<T> instances that are passed into the constructor, MergedEnumerator<T> doesn't do it automatically.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    MergedEnumerator<T>
    Implements
    IEnumerator<T>
    IEnumerator
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class MergedEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : IComparable<T>
    Type Parameters
    Name Description
    T

    Constructors

    MergedEnumerator(bool, params IEnumerator<T>[])

    Provides a merged sorted view from several sorted iterators.

    If built with removeDuplicates set to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.

    If built with removeDuplicates set to false then all elements in all iterators are returned.

    Caveats:
    • The behavior is undefined if the iterators are not actually sorted.
    • Null elements are unsupported.
    • If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
    • When elements are deduplicated it is not defined which one is returned.
    • If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.

    The caller is responsible for disposing the IEnumerator<T> instances that are passed into the constructor, MergedEnumerator<T> doesn't do it automatically.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public MergedEnumerator(bool removeDuplicates, params IEnumerator<T>[] enumerators)
    Parameters
    Type Name Description
    bool removeDuplicates
    IEnumerator<T>[] enumerators

    MergedEnumerator(bool, IList<IEnumerator<T>>)

    Provides a merged sorted view from several sorted iterators.

    If built with removeDuplicates set to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.

    If built with removeDuplicates set to false then all elements in all iterators are returned.

    Caveats:
    • The behavior is undefined if the iterators are not actually sorted.
    • Null elements are unsupported.
    • If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
    • When elements are deduplicated it is not defined which one is returned.
    • If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.

    The caller is responsible for disposing the IEnumerator<T> instances that are passed into the constructor, MergedEnumerator<T> doesn't do it automatically.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public MergedEnumerator(bool removeDuplicates, IList<IEnumerator<T>> enumerators)
    Parameters
    Type Name Description
    bool removeDuplicates
    IList<IEnumerator<T>> enumerators

    MergedEnumerator(params IEnumerator<T>[])

    Provides a merged sorted view from several sorted iterators.

    If built with removeDuplicates set to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.

    If built with removeDuplicates set to false then all elements in all iterators are returned.

    Caveats:
    • The behavior is undefined if the iterators are not actually sorted.
    • Null elements are unsupported.
    • If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
    • When elements are deduplicated it is not defined which one is returned.
    • If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.

    The caller is responsible for disposing the IEnumerator<T> instances that are passed into the constructor, MergedEnumerator<T> doesn't do it automatically.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public MergedEnumerator(params IEnumerator<T>[] enumerators)
    Parameters
    Type Name Description
    IEnumerator<T>[] enumerators

    MergedEnumerator(IList<IEnumerator<T>>)

    Provides a merged sorted view from several sorted iterators.

    If built with removeDuplicates set to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.

    If built with removeDuplicates set to false then all elements in all iterators are returned.

    Caveats:
    • The behavior is undefined if the iterators are not actually sorted.
    • Null elements are unsupported.
    • If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
    • When elements are deduplicated it is not defined which one is returned.
    • If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.

    The caller is responsible for disposing the IEnumerator<T> instances that are passed into the constructor, MergedEnumerator<T> doesn't do it automatically.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public MergedEnumerator(IList<IEnumerator<T>> enumerators)
    Parameters
    Type Name Description
    IList<IEnumerator<T>> enumerators

    Properties

    Current

    Gets the element in the collection at the current position of the enumerator.

    Declaration
    public T Current { get; }
    Property Value
    Type Description
    T

    The element in the collection at the current position of the enumerator.

    Methods

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    MoveNext()

    Advances the enumerator to the next element of the collection.

    Declaration
    public bool MoveNext()
    Returns
    Type Description
    bool

    true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

    Exceptions
    Type Condition
    InvalidOperationException

    The collection was modified after the enumerator was created.

    Reset()

    Sets the enumerator to its initial position, which is before the first element in the collection.

    Declaration
    public void Reset()
    Exceptions
    Type Condition
    InvalidOperationException

    The collection was modified after the enumerator was created.

    NotSupportedException

    The enumerator does not support being reset.

    Implements

    IEnumerator<T>
    IEnumerator
    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.