2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 using NumericTokenStream = Mono.Lucene.Net.Analysis.NumericTokenStream;
21 using NumericField = Mono.Lucene.Net.Documents.NumericField;
22 using IndexReader = Mono.Lucene.Net.Index.IndexReader;
23 using NumericUtils = Mono.Lucene.Net.Util.NumericUtils;
24 using RamUsageEstimator = Mono.Lucene.Net.Util.RamUsageEstimator;
26 namespace Mono.Lucene.Net.Search
29 /// <summary> Expert: Maintains caches of term values.
31 /// <p/>Created: May 19, 2004 11:13:14 AM
34 /// <since> lucene 1.4
36 /// <version> $Id: FieldCache.java 807841 2009-08-25 22:27:31Z markrmiller $
38 /// <seealso cref="Mono.Lucene.Net.Util.FieldCacheSanityChecker">
40 public sealed class CreationPlaceholder
42 internal System.Object value_Renamed;
44 /// <summary>Expert: Stores term text values and document ordering data. </summary>
45 public class StringIndex
48 public virtual int BinarySearchLookup(System.String key)
50 // this special case is the reason that Arrays.binarySearch() isn't useful.
55 int high = lookup.Length - 1;
59 int mid = SupportClass.Number.URShift((low + high), 1);
60 int cmp = String.CompareOrdinal(lookup[mid], key);
67 return mid; // key found
69 return - (low + 1); // key not found.
72 /// <summary>All the term values, in natural order. </summary>
73 public System.String[] lookup;
75 /// <summary>For each document, an index into the lookup array. </summary>
78 /// <summary>Creates one of these objects </summary>
79 public StringIndex(int[] values, System.String[] lookup)
85 /// <summary> EXPERT: A unique Identifier/Description for each item in the FieldCache.
86 /// Can be useful for logging/debugging.
88 /// <b>EXPERIMENTAL API:</b> This API is considered extremely advanced
89 /// and experimental. It may be removed or altered w/o warning in future
94 public abstract class CacheEntry
96 public abstract System.Object GetReaderKey();
97 public abstract System.String GetFieldName();
98 public abstract System.Type GetCacheType();
99 public abstract System.Object GetCustom();
100 public abstract System.Object GetValue();
101 private System.String size = null;
102 protected internal void SetEstimatedSize(System.String size)
106 /// <seealso cref="EstimateSize(RamUsageEstimator)">
108 public virtual void EstimateSize()
110 EstimateSize(new RamUsageEstimator(false)); // doesn't check for interned
112 /// <summary> Computes (and stores) the estimated size of the cache Value </summary>
113 /// <seealso cref="getEstimatedSize">
115 public virtual void EstimateSize(RamUsageEstimator ramCalc)
117 long size = ramCalc.EstimateRamUsage(GetValue());
118 SetEstimatedSize(RamUsageEstimator.HumanReadableUnits(size, new System.Globalization.NumberFormatInfo())); // {{Aroush-2.9}} in Java, the formater is set to "0.#", so we need to do the same in C#
120 /// <summary> The most recently estimated size of the value, null unless
121 /// estimateSize has been called.
123 public System.String GetEstimatedSize()
129 public override System.String ToString()
131 System.Text.StringBuilder b = new System.Text.StringBuilder();
132 b.Append("'").Append(GetReaderKey()).Append("'=>");
133 b.Append("'").Append(GetFieldName()).Append("',");
134 b.Append(GetCacheType()).Append(",").Append(GetCustom());
135 b.Append("=>").Append(GetValue().GetType().FullName).Append("#");
136 b.Append(GetValue().GetHashCode());
138 System.String s = GetEstimatedSize();
141 b.Append(" (size =~ ").Append(s).Append(')');
147 public struct FieldCache_Fields{
148 /// <summary>Indicator for StringIndex values in the cache. </summary>
149 // NOTE: the value assigned to this constant must not be
150 // the same as any of those in SortField!!
151 public readonly static int STRING_INDEX = - 1;
152 /// <summary>Expert: The cache used internally by sorting and range query classes. </summary>
153 public readonly static FieldCache DEFAULT;
154 /// <summary>The default parser for byte values, which are encoded by {@link Byte#toString(byte)} </summary>
155 public readonly static ByteParser DEFAULT_BYTE_PARSER;
156 /// <summary>The default parser for short values, which are encoded by {@link Short#toString(short)} </summary>
157 public readonly static ShortParser DEFAULT_SHORT_PARSER;
158 /// <summary>The default parser for int values, which are encoded by {@link Integer#toString(int)} </summary>
159 public readonly static IntParser DEFAULT_INT_PARSER;
160 /// <summary>The default parser for float values, which are encoded by {@link Float#toString(float)} </summary>
161 public readonly static FloatParser DEFAULT_FLOAT_PARSER;
162 /// <summary>The default parser for long values, which are encoded by {@link Long#toString(long)} </summary>
163 public readonly static LongParser DEFAULT_LONG_PARSER;
164 /// <summary>The default parser for double values, which are encoded by {@link Double#toString(double)} </summary>
165 public readonly static DoubleParser DEFAULT_DOUBLE_PARSER;
166 /// <summary> A parser instance for int values encoded by {@link NumericUtils#IntToPrefixCoded(int)}, e.g. when indexed
167 /// via {@link NumericField}/{@link NumericTokenStream}.
169 public readonly static IntParser NUMERIC_UTILS_INT_PARSER;
170 /// <summary> A parser instance for float values encoded with {@link NumericUtils}, e.g. when indexed
171 /// via {@link NumericField}/{@link NumericTokenStream}.
173 public readonly static FloatParser NUMERIC_UTILS_FLOAT_PARSER;
174 /// <summary> A parser instance for long values encoded by {@link NumericUtils#LongToPrefixCoded(long)}, e.g. when indexed
175 /// via {@link NumericField}/{@link NumericTokenStream}.
177 public readonly static LongParser NUMERIC_UTILS_LONG_PARSER;
178 /// <summary> A parser instance for double values encoded with {@link NumericUtils}, e.g. when indexed
179 /// via {@link NumericField}/{@link NumericTokenStream}.
181 public readonly static DoubleParser NUMERIC_UTILS_DOUBLE_PARSER;
182 static FieldCache_Fields()
184 DEFAULT = new FieldCacheImpl();
185 DEFAULT_BYTE_PARSER = new AnonymousClassByteParser();
186 DEFAULT_SHORT_PARSER = new AnonymousClassShortParser();
187 DEFAULT_INT_PARSER = new AnonymousClassIntParser();
188 DEFAULT_FLOAT_PARSER = new AnonymousClassFloatParser();
189 DEFAULT_LONG_PARSER = new AnonymousClassLongParser();
190 DEFAULT_DOUBLE_PARSER = new AnonymousClassDoubleParser();
191 NUMERIC_UTILS_INT_PARSER = new AnonymousClassIntParser1();
192 NUMERIC_UTILS_FLOAT_PARSER = new AnonymousClassFloatParser1();
193 NUMERIC_UTILS_LONG_PARSER = new AnonymousClassLongParser1();
194 NUMERIC_UTILS_DOUBLE_PARSER = new AnonymousClassDoubleParser1();
199 class AnonymousClassByteParser : ByteParser
201 public virtual sbyte ParseByte(System.String value_Renamed)
203 return System.SByte.Parse(value_Renamed);
205 protected internal virtual System.Object ReadResolve()
207 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_BYTE_PARSER;
209 public override System.String ToString()
211 return typeof(FieldCache).FullName + ".DEFAULT_BYTE_PARSER";
215 class AnonymousClassShortParser : ShortParser
217 public virtual short ParseShort(System.String value_Renamed)
219 return System.Int16.Parse(value_Renamed);
221 protected internal virtual System.Object ReadResolve()
223 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_SHORT_PARSER;
225 public override System.String ToString()
227 return typeof(FieldCache).FullName + ".DEFAULT_SHORT_PARSER";
231 class AnonymousClassIntParser : IntParser
233 public virtual int ParseInt(System.String value_Renamed)
235 return System.Int32.Parse(value_Renamed);
237 protected internal virtual System.Object ReadResolve()
239 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_INT_PARSER;
241 public override System.String ToString()
243 return typeof(FieldCache).FullName + ".DEFAULT_INT_PARSER";
247 class AnonymousClassFloatParser : FloatParser
249 public virtual float ParseFloat(System.String value_Renamed)
253 return SupportClass.Single.Parse(value_Renamed);
255 catch (System.OverflowException)
257 return value_Renamed.StartsWith("-") ? float.PositiveInfinity : float.NegativeInfinity;
260 protected internal virtual System.Object ReadResolve()
262 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_FLOAT_PARSER;
264 public override System.String ToString()
266 return typeof(FieldCache).FullName + ".DEFAULT_FLOAT_PARSER";
270 class AnonymousClassLongParser : LongParser
272 public virtual long ParseLong(System.String value_Renamed)
274 return System.Int64.Parse(value_Renamed);
276 protected internal virtual System.Object ReadResolve()
278 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_LONG_PARSER;
280 public override System.String ToString()
282 return typeof(FieldCache).FullName + ".DEFAULT_LONG_PARSER";
286 class AnonymousClassDoubleParser : DoubleParser
288 public virtual double ParseDouble(System.String value_Renamed)
290 return SupportClass.Double.Parse(value_Renamed);
292 protected internal virtual System.Object ReadResolve()
294 return Mono.Lucene.Net.Search.FieldCache_Fields.DEFAULT_DOUBLE_PARSER;
296 public override System.String ToString()
298 return typeof(FieldCache).FullName + ".DEFAULT_DOUBLE_PARSER";
302 class AnonymousClassIntParser1 : IntParser
304 public virtual int ParseInt(System.String val)
306 int shift = val[0] - NumericUtils.SHIFT_START_INT;
307 if (shift > 0 && shift <= 31)
308 throw new FieldCacheImpl.StopFillCacheException();
309 return NumericUtils.PrefixCodedToInt(val);
311 protected internal virtual System.Object ReadResolve()
313 return Mono.Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_INT_PARSER;
315 public override System.String ToString()
317 return typeof(FieldCache).FullName + ".NUMERIC_UTILS_INT_PARSER";
321 class AnonymousClassFloatParser1 : FloatParser
323 public virtual float ParseFloat(System.String val)
325 int shift = val[0] - NumericUtils.SHIFT_START_INT;
326 if (shift > 0 && shift <= 31)
327 throw new FieldCacheImpl.StopFillCacheException();
328 return NumericUtils.SortableIntToFloat(NumericUtils.PrefixCodedToInt(val));
330 protected internal virtual System.Object ReadResolve()
332 return Mono.Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_FLOAT_PARSER;
334 public override System.String ToString()
336 return typeof(FieldCache).FullName + ".NUMERIC_UTILS_FLOAT_PARSER";
340 class AnonymousClassLongParser1 : LongParser
342 public virtual long ParseLong(System.String val)
344 int shift = val[0] - NumericUtils.SHIFT_START_LONG;
345 if (shift > 0 && shift <= 63)
346 throw new FieldCacheImpl.StopFillCacheException();
347 return NumericUtils.PrefixCodedToLong(val);
349 protected internal virtual System.Object ReadResolve()
351 return Mono.Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_LONG_PARSER;
353 public override System.String ToString()
355 return typeof(FieldCache).FullName + ".NUMERIC_UTILS_LONG_PARSER";
359 class AnonymousClassDoubleParser1 : DoubleParser
361 public virtual double ParseDouble(System.String val)
363 int shift = val[0] - NumericUtils.SHIFT_START_LONG;
364 if (shift > 0 && shift <= 63)
365 throw new FieldCacheImpl.StopFillCacheException();
366 return NumericUtils.SortableLongToDouble(NumericUtils.PrefixCodedToLong(val));
368 protected internal virtual System.Object ReadResolve()
370 return Mono.Lucene.Net.Search.FieldCache_Fields.NUMERIC_UTILS_DOUBLE_PARSER;
372 public override System.String ToString()
374 return typeof(FieldCache).FullName + ".NUMERIC_UTILS_DOUBLE_PARSER";
377 public interface FieldCache
380 /// <summary>Checks the internal cache for an appropriate entry, and if none is
381 /// found, reads the terms in <code>field</code> as a single byte and returns an array
382 /// of size <code>reader.maxDoc()</code> of the value each document
383 /// has in the given field.
385 /// <param name="reader"> Used to get field values.
387 /// <param name="field"> Which field contains the single byte values.
389 /// <returns> The values in the given field for each document.
391 /// <throws> IOException If any error occurs. </throws>
392 sbyte[] GetBytes(IndexReader reader, System.String field);
394 /// <summary>Checks the internal cache for an appropriate entry, and if none is found,
395 /// reads the terms in <code>field</code> as bytes and returns an array of
396 /// size <code>reader.maxDoc()</code> of the value each document has in the
399 /// <param name="reader"> Used to get field values.
401 /// <param name="field"> Which field contains the bytes.
403 /// <param name="parser"> Computes byte for string values.
405 /// <returns> The values in the given field for each document.
407 /// <throws> IOException If any error occurs. </throws>
408 sbyte[] GetBytes(IndexReader reader, System.String field, ByteParser parser);
410 /// <summary>Checks the internal cache for an appropriate entry, and if none is
411 /// found, reads the terms in <code>field</code> as shorts and returns an array
412 /// of size <code>reader.maxDoc()</code> of the value each document
413 /// has in the given field.
415 /// <param name="reader"> Used to get field values.
417 /// <param name="field"> Which field contains the shorts.
419 /// <returns> The values in the given field for each document.
421 /// <throws> IOException If any error occurs. </throws>
422 short[] GetShorts(IndexReader reader, System.String field);
424 /// <summary>Checks the internal cache for an appropriate entry, and if none is found,
425 /// reads the terms in <code>field</code> as shorts and returns an array of
426 /// size <code>reader.maxDoc()</code> of the value each document has in the
429 /// <param name="reader"> Used to get field values.
431 /// <param name="field"> Which field contains the shorts.
433 /// <param name="parser"> Computes short for string values.
435 /// <returns> The values in the given field for each document.
437 /// <throws> IOException If any error occurs. </throws>
438 short[] GetShorts(IndexReader reader, System.String field, ShortParser parser);
440 /// <summary>Checks the internal cache for an appropriate entry, and if none is
441 /// found, reads the terms in <code>field</code> as integers and returns an array
442 /// of size <code>reader.maxDoc()</code> of the value each document
443 /// has in the given field.
445 /// <param name="reader"> Used to get field values.
447 /// <param name="field"> Which field contains the integers.
449 /// <returns> The values in the given field for each document.
451 /// <throws> IOException If any error occurs. </throws>
452 int[] GetInts(IndexReader reader, System.String field);
454 /// <summary>Checks the internal cache for an appropriate entry, and if none is found,
455 /// reads the terms in <code>field</code> as integers and returns an array of
456 /// size <code>reader.maxDoc()</code> of the value each document has in the
459 /// <param name="reader"> Used to get field values.
461 /// <param name="field"> Which field contains the integers.
463 /// <param name="parser"> Computes integer for string values.
465 /// <returns> The values in the given field for each document.
467 /// <throws> IOException If any error occurs. </throws>
468 int[] GetInts(IndexReader reader, System.String field, IntParser parser);
470 /// <summary>Checks the internal cache for an appropriate entry, and if
471 /// none is found, reads the terms in <code>field</code> as floats and returns an array
472 /// of size <code>reader.maxDoc()</code> of the value each document
473 /// has in the given field.
475 /// <param name="reader"> Used to get field values.
477 /// <param name="field"> Which field contains the floats.
479 /// <returns> The values in the given field for each document.
481 /// <throws> IOException If any error occurs. </throws>
482 float[] GetFloats(IndexReader reader, System.String field);
484 /// <summary>Checks the internal cache for an appropriate entry, and if
485 /// none is found, reads the terms in <code>field</code> as floats and returns an array
486 /// of size <code>reader.maxDoc()</code> of the value each document
487 /// has in the given field.
489 /// <param name="reader"> Used to get field values.
491 /// <param name="field"> Which field contains the floats.
493 /// <param name="parser"> Computes float for string values.
495 /// <returns> The values in the given field for each document.
497 /// <throws> IOException If any error occurs. </throws>
498 float[] GetFloats(IndexReader reader, System.String field, FloatParser parser);
500 /// <summary> Checks the internal cache for an appropriate entry, and if none is
501 /// found, reads the terms in <code>field</code> as longs and returns an array
502 /// of size <code>reader.maxDoc()</code> of the value each document
503 /// has in the given field.
506 /// <param name="reader">Used to get field values.
508 /// <param name="field"> Which field contains the longs.
510 /// <returns> The values in the given field for each document.
512 /// <throws> java.io.IOException If any error occurs. </throws>
513 long[] GetLongs(IndexReader reader, System.String field);
515 /// <summary> Checks the internal cache for an appropriate entry, and if none is found,
516 /// reads the terms in <code>field</code> as longs and returns an array of
517 /// size <code>reader.maxDoc()</code> of the value each document has in the
521 /// <param name="reader">Used to get field values.
523 /// <param name="field"> Which field contains the longs.
525 /// <param name="parser">Computes integer for string values.
527 /// <returns> The values in the given field for each document.
529 /// <throws> IOException If any error occurs. </throws>
530 long[] GetLongs(IndexReader reader, System.String field, LongParser parser);
533 /// <summary> Checks the internal cache for an appropriate entry, and if none is
534 /// found, reads the terms in <code>field</code> as integers and returns an array
535 /// of size <code>reader.maxDoc()</code> of the value each document
536 /// has in the given field.
539 /// <param name="reader">Used to get field values.
541 /// <param name="field"> Which field contains the doubles.
543 /// <returns> The values in the given field for each document.
545 /// <throws> IOException If any error occurs. </throws>
546 double[] GetDoubles(IndexReader reader, System.String field);
548 /// <summary> Checks the internal cache for an appropriate entry, and if none is found,
549 /// reads the terms in <code>field</code> as doubles and returns an array of
550 /// size <code>reader.maxDoc()</code> of the value each document has in the
554 /// <param name="reader">Used to get field values.
556 /// <param name="field"> Which field contains the doubles.
558 /// <param name="parser">Computes integer for string values.
560 /// <returns> The values in the given field for each document.
562 /// <throws> IOException If any error occurs. </throws>
563 double[] GetDoubles(IndexReader reader, System.String field, DoubleParser parser);
565 /// <summary>Checks the internal cache for an appropriate entry, and if none
566 /// is found, reads the term values in <code>field</code> and returns an array
567 /// of size <code>reader.maxDoc()</code> containing the value each document
568 /// has in the given field.
570 /// <param name="reader"> Used to get field values.
572 /// <param name="field"> Which field contains the strings.
574 /// <returns> The values in the given field for each document.
576 /// <throws> IOException If any error occurs. </throws>
577 System.String[] GetStrings(IndexReader reader, System.String field);
579 /// <summary>Checks the internal cache for an appropriate entry, and if none
580 /// is found reads the term values in <code>field</code> and returns
581 /// an array of them in natural order, along with an array telling
582 /// which element in the term array each document uses.
584 /// <param name="reader"> Used to get field values.
586 /// <param name="field"> Which field contains the strings.
588 /// <returns> Array of terms and index into the array for each document.
590 /// <throws> IOException If any error occurs. </throws>
591 StringIndex GetStringIndex(IndexReader reader, System.String field);
593 /// <summary>Checks the internal cache for an appropriate entry, and if
594 /// none is found reads <code>field</code> to see if it contains integers, longs, floats
595 /// or strings, and then calls one of the other methods in this class to get the
596 /// values. For string values, a StringIndex is returned. After
597 /// calling this method, there is an entry in the cache for both
598 /// type <code>AUTO</code> and the actual found type.
600 /// <param name="reader"> Used to get field values.
602 /// <param name="field"> Which field contains the values.
604 /// <returns> int[], long[], float[] or StringIndex.
606 /// <throws> IOException If any error occurs. </throws>
607 /// <deprecated> Please specify the exact type, instead.
608 /// Especially, guessing does <b>not</b> work with the new
609 /// {@link NumericField} type.
611 [Obsolete("Please specify the exact type, instead. Especially, guessing does not work with the new NumericField type.")]
612 System.Object GetAuto(IndexReader reader, System.String field);
614 /// <summary>Checks the internal cache for an appropriate entry, and if none
615 /// is found reads the terms out of <code>field</code> and calls the given SortComparator
616 /// to get the sort values. A hit in the cache will happen if <code>reader</code>,
617 /// <code>field</code>, and <code>comparator</code> are the same (using <code>equals()</code>)
618 /// as a previous call to this method.
620 /// <param name="reader"> Used to get field values.
622 /// <param name="field"> Which field contains the values.
624 /// <param name="comparator">Used to convert terms into something to sort by.
626 /// <returns> Array of sort objects, one for each document.
628 /// <throws> IOException If any error occurs. </throws>
629 /// <deprecated> Please implement {@link
630 /// FieldComparatorSource} directly, instead.
632 [Obsolete("Please implement FieldComparatorSource directly, instead.")]
633 System.IComparable[] GetCustom(IndexReader reader, System.String field, SortComparator comparator);
635 /// <summary> EXPERT: Generates an array of CacheEntry objects representing all items
636 /// currently in the FieldCache.
638 /// NOTE: These CacheEntry objects maintain a strong refrence to the
639 /// Cached Values. Maintaining refrences to a CacheEntry the IndexReader
640 /// associated with it has garbage collected will prevent the Value itself
641 /// from being garbage collected when the Cache drops the WeakRefrence.
644 /// <b>EXPERIMENTAL API:</b> This API is considered extremely advanced
645 /// and experimental. It may be removed or altered w/o warning in future
650 CacheEntry[] GetCacheEntries();
653 /// EXPERT: Instructs the FieldCache to forcibly expunge all entries
654 /// from the underlying caches. This is intended only to be used for
655 /// test methods as a way to ensure a known base state of the Cache
656 /// (with out needing to rely on GC to free WeakReferences).
657 /// It should not be relied on for "Cache maintenance" in general
658 /// application code.
661 /// <b>EXPERIMENTAL API:</b> This API is considered extremely advanced
662 /// and experimental. It may be removed or altered w/o warning in future
667 void PurgeAllCaches();
670 /// Expert: drops all cache entries associated with this
671 /// reader. NOTE: this reader must precisely match the
672 /// reader that the cache entry is keyed on. If you pass a
673 /// top-level reader, it usually will have no effect as
674 /// Lucene now caches at the segment reader level.
676 void Purge(IndexReader r);
678 /// <summary> If non-null, FieldCacheImpl will warn whenever
679 /// entries are created that are not sane according to
680 /// {@link Mono.Lucene.Net.Util.FieldCacheSanityChecker}.
682 void SetInfoStream(System.IO.StreamWriter stream);
684 /// <summary>counterpart of {@link #SetInfoStream(PrintStream)} </summary>
685 System.IO.StreamWriter GetInfoStream();
688 /// <summary> Marker interface as super-interface to all parsers. It
689 /// is used to specify a custom parser to {@link
690 /// SortField#SortField(String, FieldCache.Parser)}.
692 public interface Parser
696 /// <summary>Interface to parse bytes from document fields.</summary>
697 /// <seealso cref="FieldCache.GetBytes(IndexReader, String, FieldCache.ByteParser)">
699 public interface ByteParser:Parser
701 /// <summary>Return a single Byte representation of this field's value. </summary>
702 sbyte ParseByte(System.String string_Renamed);
705 /// <summary>Interface to parse shorts from document fields.</summary>
706 /// <seealso cref="FieldCache.GetShorts(IndexReader, String, FieldCache.ShortParser)">
708 public interface ShortParser:Parser
710 /// <summary>Return a short representation of this field's value. </summary>
711 short ParseShort(System.String string_Renamed);
714 /// <summary>Interface to parse ints from document fields.</summary>
715 /// <seealso cref="FieldCache.GetInts(IndexReader, String, FieldCache.IntParser)">
717 public interface IntParser:Parser
719 /// <summary>Return an integer representation of this field's value. </summary>
720 int ParseInt(System.String string_Renamed);
723 /// <summary>Interface to parse floats from document fields.</summary>
724 /// <seealso cref="FieldCache.GetFloats(IndexReader, String, FieldCache.FloatParser)">
726 public interface FloatParser:Parser
728 /// <summary>Return an float representation of this field's value. </summary>
729 float ParseFloat(System.String string_Renamed);
732 /// <summary>Interface to parse long from document fields.</summary>
733 /// <seealso cref="FieldCache.GetLongs(IndexReader, String, FieldCache.LongParser)">
735 /// <deprecated> Use {@link FieldCache.LongParser}, this will be removed in Lucene 3.0
737 [Obsolete("Use FieldCache.LongParser, this will be removed in Lucene 3.0")]
738 public interface LongParser:Parser
740 /// <summary>Return an long representation of this field's value. </summary>
741 long ParseLong(System.String string_Renamed);
744 /// <summary>Interface to parse doubles from document fields.</summary>
745 /// <seealso cref="FieldCache.GetDoubles(IndexReader, String, FieldCache.DoubleParser)">
747 /// <deprecated> Use {@link FieldCache.DoubleParser}, this will be removed in Lucene 3.0
749 [Obsolete("Use FieldCache.DoubleParser, this will be removed in Lucene 3.0 ")]
750 public interface DoubleParser:Parser
752 /// <summary>Return an long representation of this field's value. </summary>
753 double ParseDouble(System.String string_Renamed);