Пример #1
0
 // This uses "U" type as the interim key for search!! ; but exposes TValue - obvious useful when TValue works as a key.
 public Func <TValue, QID <TQualification> > BuildReverseSearchBasedOnInterimKey <U>(Func <TValue, U> f) => Data.Select((x, ord) => Tuple.Create(f(x), QID.Build <TQualification>(ord))).ToDictionary().Let(d => new Func <TValue, QID <TQualification> >(x => d.GetValue(f(x))));
Пример #2
0
 public QualifiedPackedStore <TQualification, U> Transformed <U>(Func <QID <TQualification>, TValue, U> f) => new QualifiedPackedStore <TQualification, U>(Data.Select((v, ord) => f(QID.Build <TQualification>(ord), v)).ToArray());
Пример #3
0
 // This uses "U" type as the search clause, i.e. no intermediary transformer - **ONLY** use when U can serve as a search key.
 public Func <U, QID <TQualification> > BuildReverseSearchBasedOnValueDictionary <U>(Func <TValue, U> f) => Data.Select((x, ord) => Tuple.Create(f(x), QID.Build <TQualification>(ord))).ToDictionary().GetValue;
Пример #4
0
 public IEnumerable <Tuple <QID <TQualification>, TValue> > GetIDQualifiedValues() => Data.Select((x, ord) => Tuple.Create(QID.Build <TQualification>(ord), x));