1using System.Collections;
2using System.Collections.Generic;
12 private readonly Dictionary<ISemanticTriple, bool> reported;
13 private readonly IEnumerable<IEnumerator<ISemanticTriple>> enumerators;
14 private IEnumerator<IEnumerator<ISemanticTriple>> e;
15 private IEnumerator<ISemanticTriple> current;
16 private readonly
bool removeDuplicates;
25 bool RemoveDuplicates)
27 this.enumerators = Enumerators;
28 this.removeDuplicates = RemoveDuplicates;
30 if (this.removeDuplicates)
31 this.reported =
new Dictionary<ISemanticTriple, bool>();
42 object IEnumerator.Current => this.current?.Current;
49 foreach (IEnumerator<ISemanticTriple> Enumerator
in this.enumerators)
61 this.e = this.enumerators.GetEnumerator();
63 if (!this.e.MoveNext())
66 this.current = this.e.Current;
71 if (this.current.MoveNext())
73 if (this.removeDuplicates)
75 if (this.reported.ContainsKey(
this.current.Current))
78 this.reported[this.current.Current] =
true;
84 if (!this.e.MoveNext())
87 this.current = this.e.Current;
Enumerator of triples from a collection of semantic data sources. The enumerator can remove duplicate...
bool MoveNext()
Moves to next elements.
void Reset()
Resets the enumerator.
JoinedTripleEnumerator(IEnumerable< IEnumerator< ISemanticTriple > > Enumerators, bool RemoveDuplicates)
Enumerator of triples from a collection of semantic data sources. The enumerator can remove duplicate...
void Dispose()
Disposes of the enumerator and sub-enumerators.
ISemanticTriple Current
Current element
Interface for semantic triples.