public virtual void TestReset() { CompositeIterator4 iterator = NewIterator(); AssertIterator(iterator); iterator.Reset(); AssertIterator(iterator); }
private CompositeIterator4 NewIterator() { var iterators = new Collection4(); iterators.Add(IntArrays4.NewIterator(new[] { 1, 2, 3 })); iterators.Add(IntArrays4.NewIterator(new int[] {})); iterators.Add(IntArrays4.NewIterator(new[] { 4 })); iterators.Add(IntArrays4.NewIterator(new[] { 5, 6 })); var iterator = new CompositeIterator4(iterators.GetEnumerator()); return(iterator); }
public virtual IEnumerator ExecuteLazy() { CheckConstraintsEvaluationMode(); QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection(); Collection4 executionPath = ExecutionPath(r); IEnumerator candidateCollection = new Iterator4Impl(r.candidateCollection); MappingIterator executeCandidates = new _MappingIterator_438(executionPath, candidateCollection ); CompositeIterator4 resultingIDs = new CompositeIterator4(executeCandidates); if (!r.checkDuplicates) { return(resultingIDs); } return(CheckDuplicates(resultingIDs)); }
public virtual IEnumerator ExecuteSnapshot() { QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection(); Collection4 executionPath = ExecutionPath(r); IEnumerator candidatesIterator = new Iterator4Impl(r.candidateCollection); Collection4 snapshots = new Collection4(); while (candidatesIterator.MoveNext()) { QCandidates candidates = (QCandidates)candidatesIterator.Current; snapshots.Add(candidates.ExecuteSnapshot(executionPath)); } IEnumerator snapshotsIterator = snapshots.GetEnumerator(); CompositeIterator4 resultingIDs = new CompositeIterator4(snapshotsIterator); if (!r.checkDuplicates) { return(resultingIDs); } return(CheckDuplicates(resultingIDs)); }
private void AssertIterator(CompositeIterator4 iterator) { Iterator4Assert.AreEqual(IntArrays4.NewIterator(new[] { 1, 2, 3, 4, 5, 6 }), iterator); }
private IEnumerator CheckDuplicates(CompositeIterator4 executeAllCandidates) { return(Iterators.Filter(executeAllCandidates, new _IPredicate4_573())); }
public ClusterQueryResultIntIterator(IEnumerator[] iterators) { _delegate = new CompositeIterator4(iterators); }