lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject [Lucene.Net] svn commit: r1294875 [22/45] - in /incubator/lucene.net/trunk: ./ build/ build/vs2010/contrib/ build/vs2010/test/ doc/ src/ src/contrib/Analyzers/ src/contrib/Analyzers/AR/ src/contrib/Analyzers/BR/ src/contrib/Analyzers/CJK/ src/contrib/Analyzers/Cn/ ...
Date Tue, 28 Feb 2012 22:43:28 GMT
Modified: incubator/lucene.net/trunk/src/core/Search/BooleanScorer2.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/BooleanScorer2.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/BooleanScorer2.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/BooleanScorer2.cs Tue Feb 28 22:43:08 2012
@@ -28,7 +28,7 @@ namespace Lucene.Net.Search
 	/// <br/>Implements skipTo(), and has no limitations on the numbers of added scorers.
 	/// <br/>Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer.
 	/// </summary>
-	class BooleanScorer2:Scorer
+	class BooleanScorer2 : Scorer
 	{
 		private class AnonymousClassDisjunctionSumScorer:DisjunctionSumScorer
 		{
@@ -45,7 +45,8 @@ namespace Lucene.Net.Search
 				}
 				
 			}
-			internal AnonymousClassDisjunctionSumScorer(BooleanScorer2 enclosingInstance, System.Collections.IList Param1, int Param2):base(Param1, Param2)
+			internal AnonymousClassDisjunctionSumScorer(BooleanScorer2 enclosingInstance, System.Collections.Generic.IList<Scorer> scorers, int minNrShouldMatch)
+                : base(scorers, minNrShouldMatch)
 			{
 				InitBlock(enclosingInstance);
 			}
@@ -85,7 +86,8 @@ namespace Lucene.Net.Search
 				}
 				
 			}
-			internal AnonymousClassConjunctionScorer(int requiredNrMatchers, BooleanScorer2 enclosingInstance, Lucene.Net.Search.Similarity Param1, System.Collections.ICollection Param2):base(Param1, Param2)
+			internal AnonymousClassConjunctionScorer(int requiredNrMatchers, BooleanScorer2 enclosingInstance, Lucene.Net.Search.Similarity defaultSimilarity, System.Collections.Generic.IList<Scorer> requiredScorers)
+                : base(defaultSimilarity, requiredScorers)
 			{
 				InitBlock(requiredNrMatchers, enclosingInstance);
 			}
@@ -112,10 +114,10 @@ namespace Lucene.Net.Search
 				return lastDocScore;
 			}
 		}
-		
-		private System.Collections.IList requiredScorers;
-		private System.Collections.IList optionalScorers;
-		private System.Collections.IList prohibitedScorers;
+
+        private System.Collections.Generic.List<Scorer> requiredScorers;
+        private System.Collections.Generic.List<Scorer> optionalScorers;
+        private System.Collections.Generic.List<Scorer> prohibitedScorers;
 		
 		private class Coordinator
 		{
@@ -181,7 +183,11 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="optional">the list of optional scorers.
 		/// </param>
-		public BooleanScorer2(Similarity similarity, int minNrShouldMatch, System.Collections.IList required, System.Collections.IList prohibited, System.Collections.IList optional):base(similarity)
+		public BooleanScorer2(Similarity similarity, int minNrShouldMatch, 
+                                System.Collections.Generic.List<Scorer> required,
+                                System.Collections.Generic.List<Scorer> prohibited,
+                                System.Collections.Generic.List<Scorer> optional)
+            : base(similarity)
 		{
 			if (minNrShouldMatch < 0)
 			{
@@ -243,46 +249,24 @@ namespace Lucene.Net.Search
 				}
 				return lastDocScore;
 			}
-			/// <deprecated> use <see cref="DocID()" /> instead. 
-			/// </deprecated>
-            [Obsolete("use DocID() instead. ")]
-			public override int Doc()
-			{
-				return scorer.Doc();
-			}
+
 			public override int DocID()
 			{
 				return scorer.DocID();
 			}
-			/// <deprecated> use <see cref="NextDoc()" /> instead. 
-			/// </deprecated>
-            [Obsolete("use NextDoc() instead. ")]
-			public override bool Next()
-			{
-				return scorer.NextDoc() != NO_MORE_DOCS;
-			}
+
 			public override int NextDoc()
 			{
 				return scorer.NextDoc();
 			}
-			/// <deprecated> use <see cref="Advance(int)" /> instead. 
-			/// </deprecated>
-            [Obsolete("use Advance(int) instead. ")]
-			public override bool SkipTo(int docNr)
-			{
-				return scorer.Advance(docNr) != NO_MORE_DOCS;
-			}
+
 			public override int Advance(int target)
 			{
 				return scorer.Advance(target);
 			}
-			public override Explanation Explain(int docNr)
-			{
-				return scorer.Explain(docNr);
-			}
 		}
 		
-		private Scorer CountingDisjunctionSumScorer(System.Collections.IList scorers, int minNrShouldMatch)
+		private Scorer CountingDisjunctionSumScorer(System.Collections.Generic.List<Scorer> scorers, int minNrShouldMatch)
 		{
 			// each scorer from the list counted as a single matcher
 			return new AnonymousClassDisjunctionSumScorer(this, scorers, minNrShouldMatch);
@@ -290,7 +274,7 @@ namespace Lucene.Net.Search
 		
 		private static readonly Similarity defaultSimilarity;
 		
-		private Scorer CountingConjunctionSumScorer(System.Collections.IList requiredScorers)
+		private Scorer CountingConjunctionSumScorer(System.Collections.Generic.List<Scorer> requiredScorers)
 		{
 			// each scorer from the list counted as a single matcher
 			int requiredNrMatchers = requiredScorers.Count;
@@ -325,7 +309,7 @@ namespace Lucene.Net.Search
 			if (optionalScorers.Count > nrOptRequired)
 				requiredCountingSumScorer = CountingDisjunctionSumScorer(optionalScorers, nrOptRequired);
 			else if (optionalScorers.Count == 1)
-				requiredCountingSumScorer = new SingleMatchScorer(this, (Scorer) optionalScorers[0]);
+				requiredCountingSumScorer = new SingleMatchScorer(this, optionalScorers[0]);
 			else
 				requiredCountingSumScorer = CountingConjunctionSumScorer(optionalScorers);
 			return AddProhibitedScorers(requiredCountingSumScorer);
@@ -337,14 +321,17 @@ namespace Lucene.Net.Search
 			if (optionalScorers.Count == minNrShouldMatch)
 			{
 				// all optional scorers also required.
-				System.Collections.ArrayList allReq = new System.Collections.ArrayList(requiredScorers);
+                var allReq = new System.Collections.Generic.List<Scorer>(requiredScorers);
 				allReq.AddRange(optionalScorers);
 				return AddProhibitedScorers(CountingConjunctionSumScorer(allReq));
 			}
 			else
 			{
 				// optionalScorers.size() > minNrShouldMatch, and at least one required scorer
-				Scorer requiredCountingSumScorer = requiredScorers.Count == 1?new SingleMatchScorer(this, (Scorer) requiredScorers[0]):CountingConjunctionSumScorer(requiredScorers);
+				Scorer requiredCountingSumScorer = 
+                                    requiredScorers.Count == 1
+                                    ? new SingleMatchScorer(this, requiredScorers[0])
+                                    : CountingConjunctionSumScorer(requiredScorers);
 				if (minNrShouldMatch > 0)
 				{
 					// use a required disjunction scorer over the optional scorers
@@ -353,7 +340,10 @@ namespace Lucene.Net.Search
 				else
 				{
 					// minNrShouldMatch == 0
-					return new ReqOptSumScorer(AddProhibitedScorers(requiredCountingSumScorer), optionalScorers.Count == 1?new SingleMatchScorer(this, (Scorer) optionalScorers[0]):CountingDisjunctionSumScorer(optionalScorers, 1));
+					return new ReqOptSumScorer(AddProhibitedScorers(requiredCountingSumScorer), 
+                                               optionalScorers.Count == 1
+                                               ? new SingleMatchScorer(this, optionalScorers[0])
+                                               : CountingDisjunctionSumScorer(optionalScorers, 1));
 				}
 			}
 		}
@@ -365,25 +355,16 @@ namespace Lucene.Net.Search
 		/// </param>
 		private Scorer AddProhibitedScorers(Scorer requiredCountingSumScorer)
 		{
-			return (prohibitedScorers.Count == 0)?requiredCountingSumScorer:new ReqExclScorer(requiredCountingSumScorer, ((prohibitedScorers.Count == 1)?(Scorer) prohibitedScorers[0]:new DisjunctionSumScorer(prohibitedScorers)));
-		}
-		
-		/// <summary>Scores and collects all matching documents.</summary>
-		/// <param name="hc">The collector to which all matching documents are passed through
-		/// <see cref="HitCollector.Collect(int, float)" />.
-		/// <br/>When this method is used the <see cref="Explain(int)" /> method should not be used.
-		/// </param>
-		/// <deprecated> use <see cref="Score(Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Score(Collector) instead.")]
-		public override void  Score(HitCollector hc)
-		{
-			Score(new HitCollectorWrapper(hc));
+			return (prohibitedScorers.Count == 0) 
+                   ? requiredCountingSumScorer
+                   : new ReqExclScorer(requiredCountingSumScorer, 
+                                       ((prohibitedScorers.Count == 1)
+                                        ? prohibitedScorers[0]
+                                        : new DisjunctionSumScorer(prohibitedScorers)));
 		}
 		
 		/// <summary>Scores and collects all matching documents.</summary>
 		/// <param name="collector">The collector to which all matching documents are passed through.
-		/// <br/>When this method is used the <see cref="Explain(int)" /> method should not be used.
 		/// </param>
 		public override void  Score(Collector collector)
 		{
@@ -394,25 +375,6 @@ namespace Lucene.Net.Search
 			}
 		}
 		
-		/// <summary>Expert: Collects matching documents in a range.
-		/// <br/>Note that <see cref="Next()" /> must be called once before this method is
-		/// called for the first time.
-		/// </summary>
-		/// <param name="hc">The collector to which all matching documents are passed through
-		/// <see cref="HitCollector.Collect(int, float)" />.
-		/// </param>
-		/// <param name="max">Do not score documents past this.
-		/// </param>
-		/// <returns> true if more matching documents may remain.
-		/// </returns>
-		/// <deprecated> use <see cref="Score(Collector, int, int)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Score(Collector, int, int) instead.")]
-		protected internal override bool Score(HitCollector hc, int max)
-		{
-			return Score(new HitCollectorWrapper(hc), max, DocID());
-		}
-		
 		public /*protected internal*/ override bool Score(Collector collector, int max, int firstDocID)
 		{
 			doc = firstDocID;
@@ -425,27 +387,11 @@ namespace Lucene.Net.Search
 			return doc != NO_MORE_DOCS;
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead. ")]
-		public override int Doc()
-		{
-			return countingSumScorer.Doc();
-		}
-		
 		public override int DocID()
 		{
 			return doc;
 		}
 		
-		/// <deprecated> use <see cref="NextDoc()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead. ")]
-		public override bool Next()
-		{
-			return NextDoc() != NO_MORE_DOCS;
-		}
-		
 		public override int NextDoc()
 		{
 			return doc = countingSumScorer.NextDoc();
@@ -458,33 +404,11 @@ namespace Lucene.Net.Search
 			return sum * coordinator.coordFactors[coordinator.nrMatchers];
 		}
 		
-		/// <deprecated> use <see cref="Advance(int)" /> instead. 
-		/// </deprecated>
-        [Obsolete("use Advance(int) instead. ")]
-		public override bool SkipTo(int target)
-		{
-			return Advance(target) != NO_MORE_DOCS;
-		}
-		
 		public override int Advance(int target)
 		{
 			return doc = countingSumScorer.Advance(target);
 		}
 		
-		/// <summary>Throws an UnsupportedOperationException.
-		/// TODO: Implement an explanation of the coordination factor.
-		/// </summary>
-		/// <param name="doc">The document number for the explanation.
-		/// </param>
-		/// <throws>  UnsupportedOperationException </throws>
-		public override Explanation Explain(int doc)
-		{
-			throw new System.NotSupportedException();
-			/* How to explain the coordination factor?
-			initCountingSumScorer();
-			return countingSumScorer.explain(doc); // misses coord factor. 
-			*/
-		}
 		static BooleanScorer2()
 		{
 			defaultSimilarity = Similarity.GetDefault();

Modified: incubator/lucene.net/trunk/src/core/Search/CachingSpanFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/CachingSpanFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/CachingSpanFilter.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/CachingSpanFilter.cs Tue Feb 28 22:43:08 2012
@@ -29,11 +29,11 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public class CachingSpanFilter:SpanFilter
 	{
-		protected internal SpanFilter filter;
+		private SpanFilter filter;
 		
-		/// <summary> A transient Filter cache.</summary>
+		/// <summary> A transient Filter cache (internal because of test)</summary>
 		[NonSerialized]
-        internal CachingWrapperFilter.FilterCache cache;
+        internal CachingWrapperFilter.FilterCache<SpanFilterResult> cache;
 
         /// <summary>
         /// New deletions always result in a cache miss, by default
@@ -59,26 +59,17 @@ namespace Lucene.Net.Search
             this.cache = new AnonymousFilterCache(deletesMode);
         }
 
-        class AnonymousFilterCache : CachingWrapperFilter.FilterCache
+        class AnonymousFilterCache : CachingWrapperFilter.FilterCache<SpanFilterResult>
         {
             public AnonymousFilterCache(CachingWrapperFilter.DeletesMode deletesMode) : base(deletesMode)
             {
             }
 
-            protected override object MergeDeletes(IndexReader reader, object docIdSet)
+            protected override SpanFilterResult MergeDeletes(IndexReader reader, SpanFilterResult docIdSet)
             {
                 throw new System.ArgumentException("DeletesMode.DYNAMIC is not supported");
             }
         }
-
-		/// <deprecated> Use <see cref="GetDocIdSet(IndexReader)" /> instead.
-		/// </deprecated>
-        [Obsolete("Use GetDocIdSet(IndexReader) instead.")]
-		public override System.Collections.BitArray Bits(IndexReader reader)
-		{
-			SpanFilterResult result = GetCachedResult(reader);
-			return result != null?result.GetBits():null;
-		}
 		
 		public override DocIdSet GetDocIdSet(IndexReader reader)
 		{
@@ -94,7 +85,7 @@ namespace Lucene.Net.Search
             object coreKey = reader.GetFieldCacheKey();
             object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
 
-            SpanFilterResult result = (SpanFilterResult) cache.Get(reader, coreKey, delCoreKey);
+            SpanFilterResult result = cache.Get(reader, coreKey, delCoreKey);
             if (result != null) {
                 hitCount++;
                 return result;

Modified: incubator/lucene.net/trunk/src/core/Search/CachingWrapperFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/CachingWrapperFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/CachingWrapperFilter.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/CachingWrapperFilter.cs Tue Feb 28 22:43:08 2012
@@ -18,9 +18,8 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Runtime.InteropServices;
+using Lucene.Net.Support;
 using IndexReader = Lucene.Net.Index.IndexReader;
-using DocIdBitSet = Lucene.Net.Util.DocIdBitSet;
 using OpenBitSetDISI = Lucene.Net.Util.OpenBitSetDISI;
 using Lucene.Net.Util;
 
@@ -56,28 +55,19 @@ namespace Lucene.Net.Search
         /// use DYNAMIC to dynamically intersect deleted docs (fast
         /// reopen time but some hit to search performance).</para>
         ///
-        [Serializable]
-        public class DeletesMode : Parameter
-        {
-            private DeletesMode(String name) : base(name)
-            {
-            }
-            public static DeletesMode IGNORE = new DeletesMode("IGNORE");
-            public static DeletesMode RECACHE = new DeletesMode("RECACHE");
-            public static DeletesMode DYNAMIC = new DeletesMode("DYNAMIC");
-        }
+        public enum DeletesMode { IGNORE, RECACHE, DYNAMIC }
 
-		internal FilterCache cache;
+		internal FilterCache<DocIdSet> cache;
 
         [Serializable]
-        abstract internal class FilterCache 
+        abstract internal class FilterCache<T> where T : class
         {
             /**
              * A transient Filter cache (package private because of test)
              */
             // NOTE: not final so that we can dynamically re-init
             // after de-serialize
-            volatile IDictionary cache;
+            volatile IDictionary<Object, T> cache;
 
             private DeletesMode deletesMode;
 
@@ -86,15 +76,15 @@ namespace Lucene.Net.Search
                 this.deletesMode = deletesMode;
             }
 
-            public Object Get(IndexReader reader, object coreKey, object delCoreKey)
+            public T Get(IndexReader reader, object coreKey, object delCoreKey)
             {
                 lock (this)
                 {
-                    object value;
+                    T value;
 
                     if (cache == null)
                     {
-                        cache = new SupportClass.WeakHashTable();
+                        cache = new WeakDictionary<object, T>();
                     }
 
                     if (deletesMode == DeletesMode.IGNORE)
@@ -131,22 +121,25 @@ namespace Lucene.Net.Search
 
             }
        
-            protected abstract object MergeDeletes(IndexReader reader, object value);
+            protected abstract T MergeDeletes(IndexReader reader, T value);
 
-            public void Put(object coreKey, object delCoreKey, object value)
+            public void Put(object coreKey, object delCoreKey, T value)
             {
-                if (deletesMode == DeletesMode.IGNORE)
-                {
-                    cache[coreKey]= value;
-                }
-                else if (deletesMode == DeletesMode.RECACHE)
-                {
-                    cache[delCoreKey]=value;
-                }
-                else
+                lock (this)
                 {
-                    cache[coreKey]= value;
-                    cache[delCoreKey]= value;
+                    if (deletesMode == DeletesMode.IGNORE)
+                    {
+                        cache[coreKey] = value;
+                    }
+                    else if (deletesMode == DeletesMode.RECACHE)
+                    {
+                        cache[delCoreKey] = value;
+                    }
+                    else
+                    {
+                        cache[coreKey] = value;
+                        cache[delCoreKey] = value;
+                    }
                 }
             }
         }
@@ -191,7 +184,7 @@ namespace Lucene.Net.Search
             //};
         }
 
-        class AnonymousFilterCache : FilterCache
+        class AnonymousFilterCache : FilterCache<DocIdSet>
         {
             class AnonymousFilteredDocIdSet : FilteredDocIdSet
             {
@@ -207,46 +200,14 @@ namespace Lucene.Net.Search
             }
 
             public AnonymousFilterCache(DeletesMode deletesMode) : base(deletesMode)
-            {
-            }
+            { }
 
-            protected  override object MergeDeletes(IndexReader reader, object docIdSet)
+            protected override DocIdSet MergeDeletes(IndexReader reader, DocIdSet docIdSet)
             {
-                return new AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
+                return new AnonymousFilteredDocIdSet(docIdSet, reader);
             }
         }
 
-		/// <deprecated> Use <see cref="GetDocIdSet(IndexReader)" /> instead.
-		/// </deprecated>
-        [Obsolete("Use GetDocIdSet(IndexReader) instead.")]
-		public override System.Collections.BitArray Bits(IndexReader reader)
-		{
-			object coreKey = reader.GetFieldCacheKey();
-            object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
-
-            object cached = cache.Get(reader, coreKey, delCoreKey);
-			
-			if (cached != null)
-			{
-				if (cached is System.Collections.BitArray)
-				{
-					return (System.Collections.BitArray) cached;
-				}
-				else if (cached is DocIdBitSet)
-					return ((DocIdBitSet) cached).GetBitSet();
-				// It would be nice to handle the DocIdSet case, but that's not really possible
-			}
-			
-			System.Collections.BitArray bits = filter.Bits(reader);
-
-            if (bits != null)
-            {
-                cache.Put(coreKey, delCoreKey, bits);
-            }
-			
-			return bits;
-		}
-		
 		/// <summary>Provide the DocIdSet to be cached, using the DocIdSet provided
 		/// by the wrapped Filter.
 		/// This implementation returns the given DocIdSet.
@@ -279,25 +240,22 @@ namespace Lucene.Net.Search
 			object coreKey = reader.GetFieldCacheKey();
             object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
 
-            object cached = cache.Get(reader, coreKey, delCoreKey);
-			
-			if (cached != null)
+            DocIdSet docIdSet = cache.Get(reader, coreKey, delCoreKey);
+
+            if (docIdSet != null)
 			{
                 hitCount++;
-				if (cached is DocIdSet)
-					return (DocIdSet) cached;
-				else
-					return new DocIdBitSet((System.Collections.BitArray) cached);
+			    return docIdSet;
 			}
             missCount++;
             // cache miss
-			DocIdSet docIdSet = DocIdSetToCache(filter.GetDocIdSet(reader), reader);
+			docIdSet = DocIdSetToCache(filter.GetDocIdSet(reader), reader);
 			
 			if (docIdSet != null)
 			{
                 cache.Put(coreKey, delCoreKey, docIdSet);
 			}
-			
+
 			return docIdSet;
 		}
 		

Modified: incubator/lucene.net/trunk/src/core/Search/Collector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Collector.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Collector.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Collector.cs Tue Feb 28 22:43:08 2012
@@ -26,13 +26,6 @@ namespace Lucene.Net.Search
 	/// gather raw results from a search, and implement sorting
 	/// or custom result filtering, collation, etc. <p/>
 	/// 
-	/// <p/>As of 2.9, this class replaces the deprecated
-	/// HitCollector, and offers an API for efficient collection
-	/// of hits across sequential <see cref="IndexReader" />s. <see cref="IndexSearcher" />
-	/// advances the collector through each of the
-	/// sub readers, in an arbitrary order. This results in a
-	/// higher performance means of collection.<p/>
-	/// 
 	/// <p/>Lucene's core collectors are derived from Collector.
 	/// Likely your application can use one of these classes, or
 	/// subclass <see cref="TopDocsCollector" />, instead of
@@ -60,8 +53,7 @@ namespace Lucene.Net.Search
 	/// 
 	/// <item><see cref="TimeLimitingCollector" />, which wraps any other
 	/// Collector and aborts the search if it's taken too much
-	/// time, will subclass Collector in 3.0 (presently it
-	/// subclasses the deprecated HitCollector).</item>
+	/// time.</item>
 	/// 
 	/// <item><see cref="PositiveScoresOnlyCollector" /> wraps any other
 	/// Collector and prevents collection of hits whose score

Modified: incubator/lucene.net/trunk/src/core/Search/ComplexExplanation.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ComplexExplanation.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ComplexExplanation.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ComplexExplanation.cs Tue Feb 28 22:43:08 2012
@@ -27,7 +27,6 @@ namespace Lucene.Net.Search
 	public class ComplexExplanation:Explanation
 	{
 		private System.Boolean? match;
-        private bool isMatchSet = false;
 		
 		public ComplexExplanation():base()
 		{
@@ -36,25 +35,37 @@ namespace Lucene.Net.Search
 		public ComplexExplanation(bool match, float value_Renamed, System.String description):base(value_Renamed, description)
 		{
 			this.match = match;
-            this.isMatchSet = true;
 		}
-		
-		/// <summary> The match status of this explanation node.</summary>
-		/// <returns> May be null if match status is unknown
-		/// </returns>
-		public virtual System.Boolean? GetMatch()
-		{
-			return match;
-		}
-		/// <summary> Sets the match status assigned to this explanation node.</summary>
-		/// <param name="match">May be null if match status is unknown
-		/// </param>
-		public virtual void  SetMatch(System.Boolean? match)
-		{
-			this.match = match;
-            this.isMatchSet = true;
-		}
-		/// <summary> Indicates whether or not this Explanation models a good match.
+
+	    /// <summary> The match status of this explanation node.</summary>
+	    /// <value> May be null if match status is unknown
+	    /// </value>
+	    public virtual bool? Match
+	    {
+	        get { return match; }
+	        set { match = value; }
+	    }
+
+
+        /// <summary> The match status of this explanation node.</summary>
+        /// <returns> May be null if match status is unknown
+        /// </returns>
+        [Obsolete("Use Match property instead")]
+        public virtual System.Boolean? GetMatch()
+        {
+            return Match;
+        }
+
+        /// <summary> Sets the match status assigned to this explanation node.</summary>
+        /// <param name="match">May be null if match status is unknown
+        /// </param>
+        [Obsolete("Use Match property instead")]
+        public virtual void SetMatch(System.Boolean? match)
+        {
+            Match = match;
+        }
+
+	    /// <summary> Indicates whether or not this Explanation models a good match.
 		/// 
 		/// <p/>
 		/// If the match status is explicitly set (i.e.: not null) this method
@@ -65,16 +76,19 @@ namespace Lucene.Net.Search
 		/// </seealso>
 		public override bool IsMatch()
 		{
-			System.Boolean? m = GetMatch();
+			System.Boolean? m = Match;
             return m ?? base.IsMatch();
 		}
-		
-		protected internal override System.String GetSummary()
-		{
-            if (isMatchSet == false)
-				return base.GetSummary();
-			
-			return GetValue() + " = " + (IsMatch()?"(MATCH) ":"(NON-MATCH) ") + GetDescription();
-		}
+
+	    protected internal override string Summary
+	    {
+	        get
+	        {
+	            if (!match.HasValue)
+	                return base.Summary;
+
+	            return Value + " = " + (IsMatch() ? "(MATCH) " : "(NON-MATCH) ") + Description;
+	        }
+	    }
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/ConjunctionScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ConjunctionScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ConjunctionScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ConjunctionScorer.cs Tue Feb 28 22:43:08 2012
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Linq;
 
 namespace Lucene.Net.Search
 {
@@ -23,41 +24,16 @@ namespace Lucene.Net.Search
 	/// <summary>Scorer for conjunctions, sets of queries, all of which are required. </summary>
 	class ConjunctionScorer:Scorer
 	{
-		private class AnonymousClassComparator : System.Collections.IComparer
-		{
-			public AnonymousClassComparator(ConjunctionScorer enclosingInstance)
-			{
-				InitBlock(enclosingInstance);
-			}
-			private void  InitBlock(ConjunctionScorer enclosingInstance)
-			{
-				this.enclosingInstance = enclosingInstance;
-			}
-			private ConjunctionScorer enclosingInstance;
-			public ConjunctionScorer Enclosing_Instance
-			{
-				get
-				{
-					return enclosingInstance;
-				}
-				
-			}
-			// sort the array
-			public virtual int Compare(System.Object o1, System.Object o2)
-			{
-				return ((Scorer) o1).DocID() - ((Scorer) o2).DocID();
-			}
-		}
-		
 		private Scorer[] scorers;
 		private float coord;
 		private int lastDoc = - 1;
 		
-		public ConjunctionScorer(Similarity similarity, System.Collections.ICollection scorers):this(similarity, (Scorer[]) new System.Collections.ArrayList(scorers).ToArray(typeof(Scorer)))
+		public ConjunctionScorer(Similarity similarity, System.Collections.Generic.ICollection<Scorer> scorers)
+            : this(similarity, scorers.ToArray())
 		{
 		}
 		
-		public ConjunctionScorer(Similarity similarity, Scorer[] scorers):base(similarity)
+		public ConjunctionScorer(Similarity similarity, params Scorer[] scorers):base(similarity)
 		{
 			this.scorers = scorers;
 			coord = similarity.Coord(scorers.Length, scorers.Length);
@@ -78,7 +54,7 @@ namespace Lucene.Net.Search
 			// it will already start off sorted (all scorers on same doc).
 			
 			// note that this comparator is not consistent with equals!
-			System.Array.Sort(scorers, new AnonymousClassComparator(this));
+		    System.Array.Sort(scorers, (a, b) => a.DocID() - b.DocID());
 			
 			// NOTE: doNext() must be called before the re-sorting of the array later on.
 			// The reason is this: assume there are 5 scorers, whose first docs are 1,
@@ -88,7 +64,7 @@ namespace Lucene.Net.Search
 			// However, if we re-sort before doNext() is called, the order will be 5, 3,
 			// 2, 1, 5 and then doNext() will stop immediately, since the first scorer's
 			// docs equals the last one. So the invariant that after calling doNext() 
-			// all scorers are on the same doc ID is broken.
+			// all scorers are on the same doc ID is broken.);
 			if (DoNext() == NO_MORE_DOCS)
 			{
 				// The scorers did not agree on any document.
@@ -139,32 +115,11 @@ namespace Lucene.Net.Search
 			return lastDoc = DoNext();
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead.")]
-		public override int Doc()
-		{
-			return lastDoc;
-		}
-		
 		public override int DocID()
 		{
 			return lastDoc;
 		}
 		
-		public override Explanation Explain(int doc)
-		{
-			throw new System.NotSupportedException();
-		}
-		
-		/// <deprecated> use <see cref="NextDoc()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead.")]
-		public override bool Next()
-		{
-			return NextDoc() != NO_MORE_DOCS;
-		}
-		
 		public override int NextDoc()
 		{
 			if (lastDoc == NO_MORE_DOCS)
@@ -188,13 +143,5 @@ namespace Lucene.Net.Search
 			}
 			return sum * coord;
 		}
-		
-		/// <deprecated> use <see cref="Advance(int)" /> instead. 
-		/// </deprecated>
-        [Obsolete("use Advance(int) instead.")]
-		public override bool SkipTo(int target)
-		{
-			return Advance(target) != NO_MORE_DOCS;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/ConstantScoreQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ConstantScoreQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ConstantScoreQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ConstantScoreQuery.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using Lucene.Net.Index;
 using IndexReader = Lucene.Net.Index.IndexReader;
 
 namespace Lucene.Net.Search
@@ -24,11 +24,7 @@ namespace Lucene.Net.Search
 	
 	/// <summary> A query that wraps a filter and simply returns a constant score equal to the
 	/// query boost for every document in the filter.
-	/// 
-	/// 
 	/// </summary>
-	/// <version>  $Id: ConstantScoreQuery.java 807180 2009-08-24 12:26:43Z markrmiller $
-	/// </version>
 	[Serializable]
 	public class ConstantScoreQuery:Query
 	{
@@ -50,7 +46,7 @@ namespace Lucene.Net.Search
 			return this;
 		}
 		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
 			// OK to not add any terms when used for MultiSearcher,
 			// but may not be OK for highlighting
@@ -119,25 +115,25 @@ namespace Lucene.Net.Search
 				
 				if (exists)
 				{
-					result.SetDescription("ConstantScoreQuery(" + Enclosing_Instance.filter + "), product of:");
-					result.SetValue(queryWeight);
+					result.Description = "ConstantScoreQuery(" + Enclosing_Instance.filter + "), product of:";
+					result.Value = queryWeight;
 					System.Boolean tempAux = true;
-					result.SetMatch(tempAux);
+					result.Match = tempAux;
 					result.AddDetail(new Explanation(Enclosing_Instance.GetBoost(), "boost"));
 					result.AddDetail(new Explanation(queryNorm, "queryNorm"));
 				}
 				else
 				{
-					result.SetDescription("ConstantScoreQuery(" + Enclosing_Instance.filter + ") doesn't match id " + doc);
-					result.SetValue(0);
+					result.Description = "ConstantScoreQuery(" + Enclosing_Instance.filter + ") doesn't match id " + doc;
+					result.Value = 0;
 					System.Boolean tempAux2 = false;
-					result.SetMatch(tempAux2);
+					result.Match = tempAux2;
 				}
 				return result;
 			}
 		}
 		
-		protected internal class ConstantScorer:Scorer
+		protected internal class ConstantScorer : Scorer
 		{
 			private void  InitBlock(ConstantScoreQuery enclosingInstance)
 			{
@@ -179,27 +175,11 @@ namespace Lucene.Net.Search
 				}
 			}
 			
-			/// <deprecated> use <see cref="NextDoc()" /> instead. 
-			/// </deprecated>
-            [Obsolete("use NextDoc() instead.")]
-			public override bool Next()
-			{
-				return docIdSetIterator.NextDoc() != NO_MORE_DOCS;
-			}
-			
 			public override int NextDoc()
 			{
 				return docIdSetIterator.NextDoc();
 			}
 			
-			/// <deprecated> use <see cref="DocID()" /> instead. 
-			/// </deprecated>
-            [Obsolete("use DocID() instead. ")]
-			public override int Doc()
-			{
-				return docIdSetIterator.Doc();
-			}
-			
 			public override int DocID()
 			{
 				return docIdSetIterator.DocID();
@@ -210,23 +190,10 @@ namespace Lucene.Net.Search
 				return theScore;
 			}
 			
-			/// <deprecated> use <see cref="Advance(int)" /> instead. 
-			/// </deprecated>
-            [Obsolete("use Advance(int) instead. ")]
-			public override bool SkipTo(int target)
-			{
-				return docIdSetIterator.Advance(target) != NO_MORE_DOCS;
-			}
-			
 			public override int Advance(int target)
 			{
 				return docIdSetIterator.Advance(target);
 			}
-			
-			public override Explanation Explain(int doc)
-			{
-				throw new System.NotSupportedException();
-			}
 		}
 		
 		public override Weight CreateWeight(Searcher searcher)

Modified: incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DefaultSimilarity.cs Tue Feb 28 22:43:08 2012
@@ -44,7 +44,7 @@ namespace Lucene.Net.Search
 				numTerms = state.GetLength() - state.GetNumOverlap();
 			else
 				numTerms = state.GetLength();
-			return (float) (state.GetBoost() * LengthNorm(field, numTerms));
+			return (state.GetBoost() * LengthNorm(field, numTerms));
 		}
 		
 		/// <summary>Implemented as <c>1/sqrt(numTerms)</c>. </summary>

Modified: incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxQuery.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,8 @@
  */
 
 using System;
-
+using Lucene.Net.Index;
+using Lucene.Net.Support;
 using IndexReader = Lucene.Net.Index.IndexReader;
 
 namespace Lucene.Net.Search
@@ -36,11 +37,11 @@ namespace Lucene.Net.Search
 	/// in the multiple fields.
 	/// </summary>
 	[Serializable]
-	public class DisjunctionMaxQuery:Query, System.ICloneable
+	public class DisjunctionMaxQuery : Query, System.Collections.Generic.IEnumerable<Query>, System.ICloneable
 	{
 		
 		/* The subqueries */
-		private SupportClass.EquatableList<Query> disjuncts = new SupportClass.EquatableList<Query>();
+		private EquatableList<Query> disjuncts = new EquatableList<Query>();
 		
 		/* Multiple of the non-max disjunct scores added into our final score.  Non-zero values support tie-breaking. */
 		private float tieBreakerMultiplier = 0.0f;
@@ -61,7 +62,7 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="tieBreakerMultiplier">  the weight to give to each matching non-maximum disjunct
 		/// </param>
-		public DisjunctionMaxQuery(System.Collections.ICollection disjuncts, float tieBreakerMultiplier)
+		public DisjunctionMaxQuery(System.Collections.Generic.ICollection<Query> disjuncts, float tieBreakerMultiplier)
 		{
 			this.tieBreakerMultiplier = tieBreakerMultiplier;
 			Add(disjuncts);
@@ -78,16 +79,21 @@ namespace Lucene.Net.Search
 		/// <summary>Add a collection of disjuncts to this disjunction
 		/// via Iterable
 		/// </summary>
-		public virtual void  Add(System.Collections.ICollection disjuncts)
+		public virtual void  Add(System.Collections.Generic.ICollection<Query> disjuncts)
 		{
 			this.disjuncts.AddRange(disjuncts);
 		}
 
         /// <summary>An Iterator&lt;Query&gt; over the disjuncts </summary>
-		public virtual System.Collections.IEnumerator Iterator()
+        public virtual System.Collections.Generic.IEnumerator<Query> GetEnumerator()
 		{
 			return disjuncts.GetEnumerator();
 		}
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
 		
 		/// <summary> Expert: the Weight for DisjunctionMaxQuery, used to
 		/// normalize, score and explain these queries.
@@ -115,16 +121,16 @@ namespace Lucene.Net.Search
 			protected internal Similarity similarity;
 			
 			/// <summary>The Weights for our subqueries, in 1-1 correspondence with disjuncts </summary>
-			protected internal System.Collections.ArrayList weights = new System.Collections.ArrayList(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
+            protected internal System.Collections.Generic.List<Weight> weights = new System.Collections.Generic.List<Weight>(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts
 			
 			/* Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
 			public DisjunctionMaxWeight(DisjunctionMaxQuery enclosingInstance, Searcher searcher)
 			{
 				InitBlock(enclosingInstance);
 				this.similarity = searcher.GetSimilarity();
-				for (System.Collections.IEnumerator iter = Enclosing_Instance.disjuncts.GetEnumerator(); iter.MoveNext(); )
+				foreach(Query disjunctQuery in enclosingInstance.disjuncts)
 				{
-					weights.Add(((Query) iter.Current).CreateWeight(searcher));
+                    weights.Add(disjunctQuery.CreateWeight(searcher));
 				}
 			}
 			
@@ -144,9 +150,9 @@ namespace Lucene.Net.Search
 			public override float SumOfSquaredWeights()
 			{
 				float max = 0.0f, sum = 0.0f;
-				for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); )
+				foreach(Weight currentWeight in weights)
 				{
-					float sub = ((Weight) iter.Current).SumOfSquaredWeights();
+                    float sub = currentWeight.SumOfSquaredWeights();
 					sum += sub;
 					max = System.Math.Max(max, sub);
 				}
@@ -158,9 +164,9 @@ namespace Lucene.Net.Search
 			public override void  Normalize(float norm)
 			{
 				norm *= Enclosing_Instance.GetBoost(); // Incorporate our boost
-				for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); )
+				foreach(Weight wt in weights)
 				{
-					((Weight) iter.Current).Normalize(norm);
+                    wt.Normalize(norm);
 				}
 			}
 			
@@ -169,9 +175,8 @@ namespace Lucene.Net.Search
 			{
 				Scorer[] scorers = new Scorer[weights.Count];
 				int idx = 0;
-				for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); )
+				foreach(Weight w in weights)
 				{
-					Weight w = (Weight) iter.Current;
 					Scorer subScorer = w.Scorer(reader, true, false);
 					if (subScorer != null && subScorer.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)
 					{
@@ -188,23 +193,23 @@ namespace Lucene.Net.Search
 			public override Explanation Explain(IndexReader reader, int doc)
 			{
 				if (Enclosing_Instance.disjuncts.Count == 1)
-					return ((Weight) weights[0]).Explain(reader, doc);
+					return weights[0].Explain(reader, doc);
 				ComplexExplanation result = new ComplexExplanation();
 				float max = 0.0f, sum = 0.0f;
-				result.SetDescription(Enclosing_Instance.tieBreakerMultiplier == 0.0f?"max of:":"max plus " + Enclosing_Instance.tieBreakerMultiplier + " times others of:");
-				for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); )
+				result.Description = Enclosing_Instance.tieBreakerMultiplier == 0.0f?"max of:":"max plus " + Enclosing_Instance.tieBreakerMultiplier + " times others of:";
+				foreach(Weight wt in weights)
 				{
-					Explanation e = ((Weight) iter.Current).Explain(reader, doc);
+					Explanation e = wt.Explain(reader, doc);
 					if (e.IsMatch())
 					{
 						System.Boolean tempAux = true;
-						result.SetMatch(tempAux);
+						result.Match = tempAux;
 						result.AddDetail(e);
-						sum += e.GetValue();
-						max = System.Math.Max(max, e.GetValue());
+						sum += e.Value;
+						max = System.Math.Max(max, e.Value);
 					}
 				}
-				result.SetValue(max + (sum - max) * Enclosing_Instance.tieBreakerMultiplier);
+				result.Value = max + (sum - max) * Enclosing_Instance.tieBreakerMultiplier;
 				return result;
 			}
 		} // end of DisjunctionMaxWeight inner class
@@ -225,7 +230,7 @@ namespace Lucene.Net.Search
 			int numDisjunctions = disjuncts.Count;
 			if (numDisjunctions == 1)
 			{
-				Query singleton = (Query) disjuncts[0];
+				Query singleton = disjuncts[0];
 				Query result = singleton.Rewrite(reader);
 				if (GetBoost() != 1.0f)
 				{
@@ -238,7 +243,7 @@ namespace Lucene.Net.Search
 			DisjunctionMaxQuery clone = null;
 			for (int i = 0; i < numDisjunctions; i++)
 			{
-				Query clause = (Query) disjuncts[i];
+				Query clause = disjuncts[i];
 				Query rewrite = clause.Rewrite(reader);
 				if (rewrite != clause)
 				{
@@ -259,16 +264,16 @@ namespace Lucene.Net.Search
 		public override System.Object Clone()
 		{
 			DisjunctionMaxQuery clone = (DisjunctionMaxQuery) base.Clone();
-            clone.disjuncts = (SupportClass.EquatableList<Query>) this.disjuncts.Clone();
+            clone.disjuncts = (EquatableList<Query>) this.disjuncts.Clone();
 			return clone;
 		}
 		
 		// inherit javadoc
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
-			for (System.Collections.IEnumerator iter = disjuncts.GetEnumerator(); iter.MoveNext(); )
+			foreach(Query query in disjuncts)
 			{
-				((Query) iter.Current).ExtractTerms(terms);
+				query.ExtractTerms(terms);
 			}
 		}
 		
@@ -284,7 +289,7 @@ namespace Lucene.Net.Search
 			int numDisjunctions = disjuncts.Count;
 			for (int i = 0; i < numDisjunctions; i++)
 			{
-				Query subquery = (Query) disjuncts[i];
+				Query subquery = disjuncts[i];
 				if (subquery is BooleanQuery)
 				{
 					// wrap sub-bools in parens

Modified: incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DisjunctionMaxScorer.cs Tue Feb 28 22:43:08 2012
@@ -62,19 +62,6 @@ namespace Lucene.Net.Search
 			Heapify();
 		}
 		
-		/// <summary> Generate the next document matching our associated DisjunctionMaxQuery.
-		/// 
-		/// </summary>
-		/// <returns> true iff there is a next document
-		/// </returns>
-		/// <deprecated> use <see cref="NextDoc()" /> instead.
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead.")]
-		public override bool Next()
-		{
-			return NextDoc() != NO_MORE_DOCS;
-		}
-		
 		public override int NextDoc()
 		{
 			if (numScorers == 0)
@@ -98,14 +85,6 @@ namespace Lucene.Net.Search
 			return doc = subScorers[0].DocID();
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead. ")]
-		public override int Doc()
-		{
-			return subScorers[0].Doc();
-		}
-		
 		public override int DocID()
 		{
 			return doc;
@@ -137,23 +116,6 @@ namespace Lucene.Net.Search
 			}
 		}
 		
-		/// <summary> Advance to the first document beyond the current whose number is greater
-		/// than or equal to target.
-		/// 
-		/// </summary>
-		/// <param name="target">the minimum number of the next desired document
-		/// </param>
-		/// <returns> true iff there is a document to be generated whose number is at
-		/// least target
-		/// </returns>
-		/// <deprecated> use <see cref="Advance(int)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Advance(int) instead.")]
-		public override bool SkipTo(int target)
-		{
-			return Advance(target) != NO_MORE_DOCS;
-		}
-		
 		public override int Advance(int target)
 		{
 			if (numScorers == 0)
@@ -176,16 +138,6 @@ namespace Lucene.Net.Search
 			return doc = subScorers[0].DocID();
 		}
 		
-		/// <summary>Explain a score that we computed.  UNSUPPORTED -- see explanation capability in DisjunctionMaxQuery.</summary>
-		/// <param name="doc">the number of a document we scored
-		/// </param>
-		/// <returns> the Explanation for our score
-		/// </returns>
-		public override Explanation Explain(int doc)
-		{
-			throw new System.NotSupportedException();
-		}
-		
 		// Organize subScorers into a min heap with scorers generating the earliest document on top.
 		private void  Heapify()
 		{

Modified: incubator/lucene.net/trunk/src/core/Search/DisjunctionSumScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DisjunctionSumScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DisjunctionSumScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DisjunctionSumScorer.cs Tue Feb 28 22:43:08 2012
@@ -23,8 +23,7 @@ namespace Lucene.Net.Search
 {
 	
 	/// <summary>A Scorer for OR like queries, counterpart of <c>ConjunctionScorer</c>.
-	/// This Scorer implements <see cref="DocIdSetIterator.SkipTo(int)" /> and uses skipTo() on the given Scorers. 
-	/// TODO: Implement score(HitCollector, int).
+	/// This Scorer implements <see cref="DocIdSetIterator.SkipTo(int)" /> and uses skipTo() on the given Scorers.
 	/// </summary>
 	class DisjunctionSumScorer:Scorer
 	{
@@ -32,7 +31,7 @@ namespace Lucene.Net.Search
 		private int nrScorers;
 		
 		/// <summary>The subscorers. </summary>
-		protected internal System.Collections.IList subScorers;
+		protected internal System.Collections.Generic.IList<Scorer> subScorers;
 		
 		/// <summary>The minimum number of scorers that should match. </summary>
 		private int minimumNrMatchers;
@@ -70,7 +69,7 @@ namespace Lucene.Net.Search
 		/// <br/>When minimumNrMatchers equals the number of subScorers,
 		/// it more efficient to use <c>ConjunctionScorer</c>.
 		/// </param>
-		public DisjunctionSumScorer(System.Collections.IList subScorers, int minimumNrMatchers):base(null)
+		public DisjunctionSumScorer(System.Collections.Generic.IList<Scorer> subScorers, int minimumNrMatchers):base(null)
 		{
 			
 			nrScorers = subScorers.Count;
@@ -93,7 +92,8 @@ namespace Lucene.Net.Search
 		/// <summary>Construct a <c>DisjunctionScorer</c>, using one as the minimum number
 		/// of matching subscorers.
 		/// </summary>
-		public DisjunctionSumScorer(System.Collections.IList subScorers):this(subScorers, 1)
+        public DisjunctionSumScorer(System.Collections.Generic.IList<Scorer> subScorers)
+            : this(subScorers, 1)
 		{
 		}
 		
@@ -102,11 +102,9 @@ namespace Lucene.Net.Search
 		/// </summary>
 		private void  InitScorerDocQueue()
 		{
-			System.Collections.IEnumerator si = subScorers.GetEnumerator();
 			scorerDocQueue = new ScorerDocQueue(nrScorers);
-			while (si.MoveNext())
+			foreach(Scorer se in subScorers)
 			{
-				Scorer se = (Scorer) si.Current;
 				if (se.NextDoc() != NO_MORE_DOCS)
 				{
 					// doc() method will be used in scorerDocQueue.
@@ -116,19 +114,6 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Scores and collects all matching documents.</summary>
-		/// <param name="hc">The collector to which all matching documents are passed through
-		/// <see cref="HitCollector.Collect(int, float)" />.
-		/// <br/>When this method is used the <see cref="Explain(int)" /> method should not be used.
-		/// </param>
-		/// <deprecated> use <see cref="Score(Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Score(Collector) instead.")]
-		public override void  Score(HitCollector hc)
-		{
-			Score(new HitCollectorWrapper(hc));
-		}
-		
-		/// <summary>Scores and collects all matching documents.</summary>
 		/// <param name="collector">The collector to which all matching documents are passed through.
 		/// <br/>When this method is used the <see cref="Explain(int)" /> method should not be used.
 		/// </param>
@@ -140,25 +125,6 @@ namespace Lucene.Net.Search
 				collector.Collect(currentDoc);
 			}
 		}
-		
-		/// <summary>Expert: Collects matching documents in a range.  Hook for optimization.
-		/// Note that <see cref="Next()" /> must be called once before this method is called
-		/// for the first time.
-		/// </summary>
-		/// <param name="hc">The collector to which all matching documents are passed through
-		/// <see cref="HitCollector.Collect(int, float)" />.
-		/// </param>
-		/// <param name="max">Do not score documents past this.
-		/// </param>
-		/// <returns> true if more matching documents may remain.
-		/// </returns>
-		/// <deprecated> use <see cref="Score(Collector, int, int)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Score(Collector, int, int) instead.")]
-		protected internal override bool Score(HitCollector hc, int max)
-		{
-			return Score(new HitCollectorWrapper(hc), max, DocID());
-		}
 
 	    /// <summary>Expert: Collects matching documents in a range.  Hook for optimization.
 	    /// Note that <see cref="Next()" /> must be called once before this method is called
@@ -186,14 +152,6 @@ namespace Lucene.Net.Search
 			return true;
 		}
 		
-		/// <deprecated> use <see cref="NextDoc()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead. ")]
-		public override bool Next()
-		{
-			return NextDoc() != NO_MORE_DOCS;
-		}
-		
 		public override int NextDoc()
 		{
 			if (scorerDocQueue.Size() < minimumNrMatchers || !AdvanceAfterCurrent())
@@ -269,14 +227,6 @@ namespace Lucene.Net.Search
 			return currentScore;
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead. ")]
-		public override int Doc()
-		{
-			return currentDoc;
-		}
-		
 		public override int DocID()
 		{
 			return currentDoc;
@@ -290,29 +240,8 @@ namespace Lucene.Net.Search
 			return nrMatchers;
 		}
 		
-		/// <summary> Skips to the first match beyond the current whose document number is
-		/// greater than or equal to a given target. <br/>
-		/// When this method is used the <see cref="Explain(int)" /> method should not be
-		/// used. <br/>
-		/// The implementation uses the skipTo() method on the subscorers.
-		/// 
-		/// </summary>
-		/// <param name="target">The target document number.
-		/// </param>
-		/// <returns> true iff there is such a match.
-		/// </returns>
-		/// <deprecated> use <see cref="Advance(int)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Advance(int) instead.")]
-		public override bool SkipTo(int target)
-		{
-			return Advance(target) != NO_MORE_DOCS;
-		}
-		
 		/// <summary> Advances to the first match beyond the current whose document number is
 		/// greater than or equal to a given target. <br/>
-		/// When this method is used the <see cref="Explain(int)" /> method should not be
-		/// used. <br/>
 		/// The implementation uses the skipTo() method on the subscorers.
 		/// 
 		/// </summary>
@@ -347,37 +276,5 @@ namespace Lucene.Net.Search
 			}
 			while (true);
 		}
-		
-		/// <returns> An explanation for the score of a given document. 
-		/// </returns>
-		public override Explanation Explain(int doc)
-		{
-			Explanation res = new Explanation();
-			System.Collections.IEnumerator ssi = subScorers.GetEnumerator();
-			float sumScore = 0.0f;
-			int nrMatches = 0;
-			while (ssi.MoveNext())
-			{
-				Explanation es = ((Scorer) ssi.Current).Explain(doc);
-				if (es.GetValue() > 0.0f)
-				{
-					// indicates match
-					sumScore += es.GetValue();
-					nrMatches++;
-				}
-				res.AddDetail(es);
-			}
-			if (nrMatchers >= minimumNrMatchers)
-			{
-				res.SetValue(sumScore);
-				res.SetDescription("sum over at least " + minimumNrMatchers + " of " + subScorers.Count + ":");
-			}
-			else
-			{
-				res.SetValue(0.0f);
-				res.SetDescription(nrMatches + " match(es) but at least " + minimumNrMatchers + " of " + subScorers.Count + " needed");
-			}
-			return res;
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/DocIdSetIterator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/DocIdSetIterator.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/DocIdSetIterator.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/DocIdSetIterator.cs Tue Feb 28 22:43:08 2012
@@ -28,134 +28,65 @@ namespace Lucene.Net.Search
 	/// </summary>
 	public abstract class DocIdSetIterator
 	{
-		
-		// TODO (3.0): review the javadocs and remove any references to '3.0'.
 		private int doc = - 1;
 		
 		/// <summary> When returned by <see cref="NextDoc()" />, <see cref="Advance(int)" /> and
-		/// <see cref="Doc()" /> it means there are no more docs in the iterator.
+		/// <see cref="DocID()" /> it means there are no more docs in the iterator.
 		/// </summary>
 		public static readonly int NO_MORE_DOCS = System.Int32.MaxValue;
-		
-		/// <summary> Unsupported anymore. Call <see cref="DocID()" /> instead. This method throws
-		/// <see cref="NotSupportedException" /> if called.
-		/// 
-		/// </summary>
-		/// <deprecated> use <see cref="DocID()" /> instead.
-		/// </deprecated>
-        [Obsolete("use DocID() instead.")]
-		public virtual int Doc()
-		{
-			throw new System.NotSupportedException("Call docID() instead.");
-		}
-		
-		/// <summary> Returns the following:
-		/// <list type="bullet">
-		/// <item>-1 or <see cref="NO_MORE_DOCS" /> if <see cref="NextDoc()" /> or
-		/// <see cref="Advance(int)" /> were not called yet.</item>
-		/// <item><see cref="NO_MORE_DOCS" /> if the iterator has exhausted.</item>
-		/// <item>Otherwise it should return the doc ID it is currently on.</item>
-		/// </list>
-		/// <p/>
-		/// <b>NOTE:</b> in 3.0, this method will become abstract.
-		/// 
-		/// </summary>
-		/// <since> 2.9
-		/// </since>
-		public virtual int DocID()
-		{
-			return doc;
-		}
-		
-		/// <summary> Unsupported anymore. Call <see cref="NextDoc()" /> instead. This method throws
-		/// <see cref="NotSupportedException" /> if called.
-		/// 
-		/// </summary>
-		/// <deprecated> use <see cref="NextDoc()" /> instead. This will be removed in 3.0
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead. This will be removed in 3.0")]
-		public virtual bool Next()
-		{
-			throw new System.NotSupportedException("Call nextDoc() instead.");
-		}
-		
-		/// <summary> Unsupported anymore. Call <see cref="Advance(int)" /> instead. This method throws
-        /// <see cref="NotSupportedException" /> if called.
-		/// 
-		/// </summary>
-		/// <deprecated> use <see cref="Advance(int)" /> instead. This will be removed in 3.0
-		/// </deprecated>
-        [Obsolete("use Advance(int) instead. This will be removed in 3.0")]
-		public virtual bool SkipTo(int target)
-		{
-			throw new System.NotSupportedException("Call advance() instead.");
-		}
-		
-		/// <summary> Advances to the next document in the set and returns the doc it is
-		/// currently on, or <see cref="NO_MORE_DOCS" /> if there are no more docs in the
-		/// set.<br/>
-		/// 
-		/// <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
-		/// of <see cref="Next()" />. For backward compatibility it is implemented as:
-		/// 
-        /// <code>
-		/// public int nextDoc() throws IOException {
-		///     return next() ? doc() : NO_MORE_DOCS;
-		/// }
-        /// </code>
-		/// 
-		/// <b>NOTE:</b> after the iterator has exhausted you should not call this
-		/// method, as it may result in unpredicted behavior.
-		/// 
-		/// </summary>
-		/// <since> 2.9
-		/// </since>
-		public virtual int NextDoc()
-		{
-			return doc = Next()?Doc():NO_MORE_DOCS;
-		}
-		
-		/// <summary> Advances to the first beyond the current whose document number is greater
-		/// than or equal to <i>target</i>. Returns the current document number or
-		/// <see cref="NO_MORE_DOCS" /> if there are no more docs in the set.
-		/// <p/>
-		/// Behaves as if written:
-		/// 
-        /// <code>
-		/// int advance(int target) {
-		///     int doc;
-		///     while ((doc = nextDoc()) &lt; target) {
-		///     }
-		///     return doc;
-		/// }
-        /// </code>
-		/// 
-		/// Some implementations are considerably more efficient than that.
-		/// <p/>
-		/// <b>NOTE:</b> certain implemenations may return a different value (each
-		/// time) if called several times in a row with the same target.
-		/// <p/>
-        /// <b>NOTE:</b> this method may be called with <see cref="NO_MORE_DOCS"/> for
-		/// efficiency by some Scorers. If your implementation cannot efficiently
-		/// determine that it should exhaust, it is recommended that you check for that
-		/// value in each call to this method.
-		/// <p/>
-		/// <b>NOTE:</b> after the iterator has exhausted you should not call this
-		/// method, as it may result in unpredicted behavior.
-		/// <p/>
-		/// <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
-		/// of <see cref="SkipTo(int)" />.
-		/// 
-		/// </summary>
-		/// <since> 2.9
-		/// </since>
-		public virtual int Advance(int target)
-		{
-			if (target == NO_MORE_DOCS)
-			{
-				return doc = NO_MORE_DOCS;
-			}
-			return doc = SkipTo(target)?Doc():NO_MORE_DOCS;
-		}
+
+	    /// <summary> Returns the following:
+	    /// <list type="bullet">
+	    /// <item>-1 or <see cref="NO_MORE_DOCS" /> if <see cref="NextDoc()" /> or
+	    /// <see cref="Advance(int)" /> were not called yet.</item>
+	    /// <item><see cref="NO_MORE_DOCS" /> if the iterator has exhausted.</item>
+	    /// <item>Otherwise it should return the doc ID it is currently on.</item>
+	    /// </list>
+	    /// <p/>
+	    /// </summary>
+	    public abstract int DocID();
+
+	    /// <summary> Advances to the next document in the set and returns the doc it is
+	    /// currently on, or <see cref="NO_MORE_DOCS" /> if there are no more docs in the
+	    /// set.<br/>
+	    /// 
+	    /// <b>NOTE:</b> after the iterator has exhausted you should not call this
+	    /// method, as it may result in unpredicted behavior.
+	    /// 
+	    /// </summary>
+	    public abstract int NextDoc();
+
+	    /// <summary> Advances to the first beyond the current whose document number is greater
+	    /// than or equal to <i>target</i>. Returns the current document number or
+	    /// <see cref="NO_MORE_DOCS" /> if there are no more docs in the set.
+	    /// <p/>
+	    /// Behaves as if written:
+	    /// 
+	    /// <code>
+	    /// int advance(int target) {
+	    ///     int doc;
+	    ///     while ((doc = nextDoc()) &lt; target) {
+	    ///     }
+	    ///     return doc;
+	    /// }
+	    /// </code>
+	    /// 
+	    /// Some implementations are considerably more efficient than that.
+	    /// <p/>
+	    /// <b>NOTE:</b> certain implemenations may return a different value (each
+	    /// time) if called several times in a row with the same target.
+	    /// <p/>
+	    /// <b>NOTE:</b> this method may be called with <see cref="NO_MORE_DOCS"/> for
+	    /// efficiency by some Scorers. If your implementation cannot efficiently
+	    /// determine that it should exhaust, it is recommended that you check for that
+	    /// value in each call to this method.
+	    /// <p/>
+	    /// <b>NOTE:</b> after the iterator has exhausted you should not call this
+	    /// method, as it may result in unpredicted behavior.
+	    /// <p/>
+	    /// 
+	    /// </summary>
+	    /// <since>2.9</since>
+	    public abstract int Advance(int target);
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/ExactPhraseScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/ExactPhraseScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/ExactPhraseScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/ExactPhraseScorer.cs Tue Feb 28 22:43:08 2012
@@ -36,7 +36,7 @@ namespace Lucene.Net.Search
 			for (PhrasePositions pp = first; pp != null; pp = pp.next)
 			{
 				pp.FirstPosition();
-				pq.Put(pp); // build pq from list
+				pq.Add(pp); // build pq from list
 			}
 			PqToList(); // rebuild list from pq
 			

Modified: incubator/lucene.net/trunk/src/core/Search/Explanation.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Explanation.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Explanation.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Explanation.cs Tue Feb 28 22:43:08 2012
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Search
 {
@@ -24,9 +25,9 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public class Explanation
 	{
-		private float value_Renamed; // the value of this node
-		private System.String description; // what it represents
-		private System.Collections.ArrayList details; // sub-explanations
+		private float value_Renamed;        // the value of this node
+		private System.String description;  // what it represents
+		private List<Explanation> details;  // sub-explanations
 		
 		public Explanation()
 		{
@@ -48,54 +49,90 @@ namespace Lucene.Net.Search
 		/// </seealso>
 		public virtual bool IsMatch()
 		{
-			return (0.0f < GetValue());
+			return (0.0f < Value);
 		}
-		
-		
-		
-		/// <summary>The value assigned to this explanation node. </summary>
-		public virtual float GetValue()
-		{
-			return value_Renamed;
-		}
-		/// <summary>Sets the value assigned to this explanation node. </summary>
-		public virtual void  SetValue(float value_Renamed)
-		{
-			this.value_Renamed = value_Renamed;
-		}
-		
-		/// <summary>A description of this explanation node. </summary>
-		public virtual System.String GetDescription()
-		{
-			return description;
-		}
-		/// <summary>Sets the description of this explanation node. </summary>
-		public virtual void  SetDescription(System.String description)
-		{
-			this.description = description;
-		}
-		
-		/// <summary> A short one line summary which should contain all high level
-		/// information about this Explanation, without the "Details"
-		/// </summary>
-		protected internal virtual System.String GetSummary()
-		{
-			return GetValue() + " = " + GetDescription();
-		}
-		
-		/// <summary>The sub-nodes of this explanation node. </summary>
-		public virtual Explanation[] GetDetails()
-		{
-			if (details == null)
-				return null;
-			return (Explanation[]) details.ToArray(typeof(Explanation));
-		}
-		
-		/// <summary>Adds a sub-node to this explanation node. </summary>
+
+
+	    /// <summary>The value assigned to this explanation node. </summary>
+	    public virtual float Value
+	    {
+	        get { return value_Renamed; }
+	        set { this.value_Renamed = value; }
+        }
+        
+        /// <summary>The value assigned to this explanation node. </summary>
+        [Obsolete("Use Value property instead.")]
+        public virtual float GetValue()
+        {
+            return Value;
+        }
+        /// <summary>Sets the value assigned to this explanation node. </summary>
+        [Obsolete("Use Value property instead.")]
+        public virtual void SetValue(float newValue)
+        {
+            this.Value = newValue;
+        }
+
+	    /// <summary>A description of this explanation node. </summary>
+	    public virtual string Description
+	    {
+	        get { return description; }
+	        set { this.description = value; }
+        }
+
+        /// <summary>A description of this explanation node. </summary>
+        [Obsolete("Use Description property instead.")]
+        public virtual System.String GetDescription()
+        {
+            return Description;
+        }
+        /// <summary>Sets the description of this explanation node. </summary>
+        [Obsolete("Use Description property instead.")]
+        public virtual void SetDescription(System.String description)
+        {
+            Description = description;
+        }
+
+	    /// <summary> A short one line summary which should contain all high level
+	    /// information about this Explanation, without the "Details"
+	    /// </summary>
+	    protected internal virtual string Summary
+	    {
+	        get { return Value + " = " + Description; }
+	    }
+        
+        /// <summary> A short one line summary which should contain all high level
+        /// information about this Explanation, without the "Details"
+        /// </summary>
+        [Obsolete("Use Summary property instead.")]
+        protected internal virtual System.String GetSummary()
+        {
+            return Summary;
+        }
+
+	    /// <summary>The sub-nodes of this explanation node. </summary>
+	    public virtual Explanation[] Details
+	    {
+	        get
+	        {
+	            if (details == null)
+	                return null;
+	            return details.ToArray();
+	        }
+	    }
+        
+        /// <summary>The sub-nodes of this explanation node. </summary>
+        [Obsolete("Use Details property instead.")]
+        public virtual Explanation[] GetDetails()
+        {
+            return Details;
+        }
+
+	    /// <summary>Adds a sub-node to this explanation node. </summary>
 		public virtual void  AddDetail(Explanation detail)
 		{
 			if (details == null)
-				details = new System.Collections.ArrayList();
+				details = new List<Explanation>();
 			details.Add(detail);
 		}
 		
@@ -104,17 +141,18 @@ namespace Lucene.Net.Search
 		{
 			return ToString(0);
 		}
-		public /*protected internal*/ virtual System.String ToString(int depth)
+
+		protected internal virtual System.String ToString(int depth)
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
 			for (int i = 0; i < depth; i++)
 			{
 				buffer.Append("  ");
 			}
-			buffer.Append(GetSummary());
+			buffer.Append(Summary);
 			buffer.Append("\n");
 			
-			Explanation[] details = GetDetails();
+			Explanation[] details = Details;
 			if (details != null)
 			{
 				for (int i = 0; i < details.Length; i++)
@@ -126,7 +164,6 @@ namespace Lucene.Net.Search
 			return buffer.ToString();
 		}
 		
-		
 		/// <summary>Render an explanation as HTML. </summary>
 		public virtual System.String ToHtml()
 		{
@@ -134,10 +171,10 @@ namespace Lucene.Net.Search
 			buffer.Append("<list>\n");
 			
 			buffer.Append("<item>");
-			buffer.Append(GetSummary());
+			buffer.Append(Summary);
 			buffer.Append("<br />\n");
 			
-			Explanation[] details = GetDetails();
+			Explanation[] details = Details;
 			if (details != null)
 			{
 				for (int i = 0; i < details.Length; i++)

Modified: incubator/lucene.net/trunk/src/core/Search/FieldCache.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/FieldCache.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/FieldCache.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/FieldCache.cs Tue Feb 28 22:43:08 2012
@@ -16,12 +16,14 @@
  */
 
 using System;
-
+using Lucene.Net.Support;
+using Double = Lucene.Net.Support.Double;
 using NumericTokenStream = Lucene.Net.Analysis.NumericTokenStream;
 using NumericField = Lucene.Net.Documents.NumericField;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using NumericUtils = Lucene.Net.Util.NumericUtils;
 using RamUsageEstimator = Lucene.Net.Util.RamUsageEstimator;
+using Single = Lucene.Net.Support.Single;
 
 namespace Lucene.Net.Search
 {
@@ -56,7 +58,7 @@ namespace Lucene.Net.Search
 			
 			while (low <= high)
 			{
-				int mid = SupportClass.Number.URShift((low + high), 1);
+				int mid = Number.URShift((low + high), 1);
 				int cmp = String.CompareOrdinal(lookup[mid], key);
 				
 				if (cmp < 0)
@@ -250,7 +252,7 @@ namespace Lucene.Net.Search
 		{
             try
             {
-                return SupportClass.Single.Parse(value_Renamed);
+                return Single.Parse(value_Renamed);
             }
             catch (System.OverflowException)
             {
@@ -287,7 +289,7 @@ namespace Lucene.Net.Search
 	{
 		public virtual double ParseDouble(System.String value_Renamed)
 		{
-			return SupportClass.Double.Parse(value_Renamed);
+			return Double.Parse(value_Renamed);
 		}
 		protected internal virtual System.Object ReadResolve()
 		{
@@ -590,48 +592,6 @@ namespace Lucene.Net.Search
 		/// <throws>  IOException  If any error occurs. </throws>
 		StringIndex GetStringIndex(IndexReader reader, System.String field);
 		
-		/// <summary>Checks the internal cache for an appropriate entry, and if
-		/// none is found reads <c>field</c> to see if it contains integers, longs, floats
-		/// or strings, and then calls one of the other methods in this class to get the
-		/// values.  For string values, a StringIndex is returned.  After
-		/// calling this method, there is an entry in the cache for both
-		/// type <c>AUTO</c> and the actual found type.
-		/// </summary>
-		/// <param name="reader"> Used to get field values.
-		/// </param>
-		/// <param name="field">  Which field contains the values.
-		/// </param>
-		/// <returns> int[], long[], float[] or StringIndex.
-		/// </returns>
-		/// <throws>  IOException  If any error occurs. </throws>
-		/// <deprecated> Please specify the exact type, instead.
-		/// Especially, guessing does <b>not</b> work with the new
-		/// <see cref="NumericField" /> type.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type, instead. Especially, guessing does not work with the new NumericField type.")]
-		System.Object GetAuto(IndexReader reader, System.String field);
-		
-		/// <summary>Checks the internal cache for an appropriate entry, and if none
-		/// is found reads the terms out of <c>field</c> and calls the given SortComparator
-		/// to get the sort values.  A hit in the cache will happen if <c>reader</c>,
-		/// <c>field</c>, and <c>comparator</c> are the same (using <c>equals()</c>)
-		/// as a previous call to this method.
-		/// </summary>
-		/// <param name="reader"> Used to get field values.
-		/// </param>
-		/// <param name="field">  Which field contains the values.
-		/// </param>
-		/// <param name="comparator">Used to convert terms into something to sort by.
-		/// </param>
-		/// <returns> Array of sort objects, one for each document.
-		/// </returns>
-		/// <throws>  IOException  If any error occurs. </throws>
-		/// <deprecated> Please implement <see cref="FieldComparatorSource" />
-		/// directly, instead.
-		/// </deprecated>
-        [Obsolete("Please implement FieldComparatorSource directly, instead.")]
-		System.IComparable[] GetCustom(IndexReader reader, System.String field, SortComparator comparator);
-		
 		/// <summary> EXPERT: Generates an array of CacheEntry objects representing all items 
 		/// currently in the FieldCache.
 		/// <p/>



Mime
View raw message