20 using Lucene.Net.Support;
21 using Double = Lucene.Net.Support.Double;
27 using Single = Lucene.Net.Support.Single;
29 namespace Lucene.Net.Search
45 internal System.Object value_Renamed;
51 public virtual int BinarySearchLookup(System.String key)
58 int high = lookup.Length - 1;
63 int cmp = String.CompareOrdinal(lookup[mid], key);
99 public abstract object ReaderKey {
get; }
100 public abstract string FieldName {
get; }
101 public abstract Type CacheType {
get; }
102 public abstract object Custom {
get; }
103 public abstract object Value {
get; }
107 public virtual void EstimateSize()
116 long size = ramCalc.EstimateRamUsage(Value);
117 EstimatedSize =
RamUsageEstimator.HumanReadableUnits(size,
new System.Globalization.NumberFormatInfo());
123 public string EstimatedSize {
get;
protected internal set; }
126 public override System.String ToString()
128 var b =
new System.Text.StringBuilder();
129 b.Append(
"'").Append(ReaderKey).Append(
"'=>");
130 b.Append(
"'").Append(FieldName).Append(
"',");
131 b.Append(CacheType).Append(
",").Append(Custom);
132 b.Append(
"=>").Append(Value.GetType().FullName).Append(
"#");
133 b.Append(Value.GetHashCode());
135 System.String s = EstimatedSize;
138 b.Append(
" (size =~ ").Append(s).Append(
')');
149 public readonly
static int STRING_INDEX = -1;
199 public virtual sbyte ParseByte(System.String value_Renamed)
201 return System.SByte.Parse(value_Renamed);
203 protected internal virtual System.Object ReadResolve()
205 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_BYTE_PARSER;
207 public override System.String ToString()
209 return typeof(
FieldCache).FullName +
".DEFAULT_BYTE_PARSER";
215 public virtual short ParseShort(System.String value_Renamed)
217 return System.Int16.Parse(value_Renamed);
219 protected internal virtual System.Object ReadResolve()
221 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_SHORT_PARSER;
223 public override System.String ToString()
225 return typeof(
FieldCache).FullName +
".DEFAULT_SHORT_PARSER";
231 public virtual int ParseInt(System.String value_Renamed)
233 return System.Int32.Parse(value_Renamed);
235 protected internal virtual System.Object ReadResolve()
237 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_INT_PARSER;
239 public override System.String ToString()
241 return typeof(
FieldCache).FullName +
".DEFAULT_INT_PARSER";
247 public virtual float ParseFloat(System.String value_Renamed)
253 catch (System.OverflowException)
255 return value_Renamed.StartsWith(
"-") ?
float.PositiveInfinity :
float.NegativeInfinity;
258 protected internal virtual System.Object ReadResolve()
260 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_FLOAT_PARSER;
262 public override System.String ToString()
264 return typeof(
FieldCache).FullName +
".DEFAULT_FLOAT_PARSER";
270 public virtual long ParseLong(System.String value_Renamed)
272 return System.Int64.Parse(value_Renamed);
274 protected internal virtual System.Object ReadResolve()
276 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_LONG_PARSER;
278 public override System.String ToString()
280 return typeof(
FieldCache).FullName +
".DEFAULT_LONG_PARSER";
286 public virtual double ParseDouble(System.String value_Renamed)
290 protected internal virtual System.Object ReadResolve()
292 return Lucene.Net.Search.FieldCache_Fields.DEFAULT_DOUBLE_PARSER;
294 public override System.String ToString()
296 return typeof(
FieldCache).FullName +
".DEFAULT_DOUBLE_PARSER";
302 public virtual int ParseInt(System.String val)
305 if (shift > 0 && shift <= 31)
309 protected internal virtual System.Object ReadResolve()
311 return Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_INT_PARSER;
313 public override System.String ToString()
315 return typeof(
FieldCache).FullName +
".NUMERIC_UTILS_INT_PARSER";
321 public virtual float ParseFloat(System.String val)
324 if (shift > 0 && shift <= 31)
328 protected internal virtual System.Object ReadResolve()
330 return Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_FLOAT_PARSER;
332 public override System.String ToString()
334 return typeof(
FieldCache).FullName +
".NUMERIC_UTILS_FLOAT_PARSER";
340 public virtual long ParseLong(System.String val)
343 if (shift > 0 && shift <= 63)
347 protected internal virtual System.Object ReadResolve()
349 return Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_LONG_PARSER;
351 public override System.String ToString()
353 return typeof(
FieldCache).FullName +
".NUMERIC_UTILS_LONG_PARSER";
359 public virtual double ParseDouble(System.String val)
362 if (shift > 0 && shift <= 63)
366 protected internal virtual System.Object ReadResolve()
368 return Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_DOUBLE_PARSER;
370 public override System.String ToString()
372 return typeof(
FieldCache).FullName +
".NUMERIC_UTILS_DOUBLE_PARSER";
391 sbyte[] GetBytes(
IndexReader reader, System.String field);
421 short[] GetShorts(
IndexReader reader, System.String field);
451 int[] GetInts(
IndexReader reader, System.String field);
481 float[] GetFloats(
IndexReader reader, System.String field);
512 long[] GetLongs(
IndexReader reader, System.String field);
545 double[] GetDoubles(
IndexReader reader, System.String field);
576 System.String[] GetStrings(
IndexReader reader, System.String field);
624 void PurgeAllCaches();
641 StreamWriter InfoStream {
get;
set; }
657 sbyte ParseByte(System.String string_Renamed);
666 short ParseShort(System.String string_Renamed);
675 int ParseInt(System.String string_Renamed);
684 float ParseFloat(System.String string_Renamed);
695 long ParseLong(System.String string_Renamed);
706 double ParseDouble(System.String string_Renamed);