18 using System.Collections.Generic;
19 using Lucene.Net.Index;
20 using Lucene.Net.Search.Function;
22 namespace Lucene.Net.Spatial.Util
27 protected readonly Dictionary<int, double>
cache;
32 cache =
new Dictionary<int, double>();
37 private readonly
int docBase;
39 private readonly Dictionary<int, double> cache;
43 this.docBase = docBase;
48 public override double DoubleVal(
int doc)
50 var key = docBase + doc;
52 if (!cache.TryGetValue(key, out v))
60 public override float FloatVal(
int doc)
62 return (
float)DoubleVal(doc);
65 public override string ToString(
int doc)
67 return DoubleVal(doc) +
string.Empty;
74 var vals = source.GetValues(reader);
79 public override string Description()
81 return "Cached[" + source.Description() +
"]";
84 public override bool Equals(
object o)
86 if (
this == o)
return true;
90 if (that == null)
return false;
91 if (source != null ? !source.Equals(that.source) : that.source != null)
return false;
96 public override int GetHashCode()