public IEnumerable <KeyValuePair <TKey, TRecord> > Backward() { foreach (var kv in Table.Backward()) { TKey key = KeyTransformer.From(kv.Key); TRecord rec = RecordTransformer.From(kv.Value); yield return(new KeyValuePair <TKey, TRecord>(key, rec)); } }
public IEnumerable <KeyValuePair <TKey, TRecord> > Backward(TKey to, bool hasTo, TKey from, bool hasFrom) { IData ito = hasTo ? KeyTransformer.To(to) : null; IData ifrom = hasFrom ? KeyTransformer.To(from) : null; foreach (var kv in Table.Backward(ito, hasTo, ifrom, hasFrom)) { TKey key = KeyTransformer.From(kv.Key); TRecord rec = RecordTransformer.From(kv.Value); yield return(new KeyValuePair <TKey, TRecord>(key, rec)); } }
public KeyValuePair <TKey, TRecord>?FindBefore(TKey key) { IData ikey = KeyTransformer.To(key); KeyValuePair <IData, IData>?kv = Table.FindBefore(ikey); if (!kv.HasValue) { return(null); } TKey k = KeyTransformer.From(kv.Value.Key); TRecord r = RecordTransformer.From(kv.Value.Value); return(new KeyValuePair <TKey, TRecord>(k, r)); }