C++ C#

IteratorHelpers Class

Namespace: Semata.DataStore.Util

Iterators do not implement the necessary interfaces to be used in "for each" statements, as their behaviour is different. However the extension methods in this class provide very similar functionality.

public static class IteratorHelpers

Methods

Name Description
AddTo<T, C, V>(this Iterator, C, Func<T, V>) Calls delegate f on each object of type T returned by the iterator and then adds the returned object of type V to a collection of type V objects
AddTo<T, C, V>(this Iterator, C, Func<T, bool>, Func<T, V>) Calls predicate on each object of type T returned by the iterator. If it returns true calls delegate f on the object and adds the returned object of type V to a collection of type V objects
AddTo<T, C>(this Iterator, C) Adds the objects of type T returned by the iterator to a collection of type T objects
AddTo<T, C>(this Iterator, C, Func<T, bool>) Calls predicate on each object of type T returned by the iterator and if it returns true adds the object of type V to a collection of type V objects
ForEach<T>(this Iterator, Action<T>) Performs the specified action on each object of type T returned by the iterator
ItemsNotAssociated(this Item, AssociationType) Returns a list of Items that are not associated with this Item, but could be
ItemsNotAssociated(this Item, AssociationType, ItemType) Returns a list of Items of a given ItemType that are not associated with this Item, but could be
ItemsNotAssociated(this Item, AssociationType, Iterator) Returns a list of Items in an iterator that are not associated with this Item, but could be.