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 [28/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/Sort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Sort.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Sort.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Sort.cs Tue Feb 28 22:43:08 2012
@@ -16,6 +16,7 @@
  */
 
 using System;
+using Lucene.Net.Support;
 
 namespace Lucene.Net.Search
 {
@@ -95,17 +96,13 @@ namespace Lucene.Net.Search
 	/// <p/>Created: Feb 12, 2004 10:53:57 AM
 	/// 
 	/// </summary>
-	/// <since>   lucene 1.4
-	/// </since>
-	/// <version>  $Id: Sort.java 795179 2009-07-17 18:23:30Z mikemccand $
-	/// </version>
 	[Serializable]
 	public class Sort
 	{
 		
 		/// <summary> Represents sorting by computed relevance. Using this sort criteria returns
 		/// the same results as calling
-		/// <see cref="Searcher.Search(Query)" />Searcher#search()without a sort criteria,
+		/// <see cref="Searcher.Search(Query,int)" />Searcher#search()without a sort criteria,
 		/// only with slightly more overhead.
 		/// </summary>
 		public static readonly Sort RELEVANCE = new Sort();
@@ -117,63 +114,13 @@ namespace Lucene.Net.Search
 		internal SortField[] fields;
 		
 		/// <summary> Sorts by computed relevance. This is the same sort criteria as calling
-		/// <see cref="Searcher.Search(Query)" />without a sort criteria,
+		/// <see cref="Searcher.Search(Query,int)" />without a sort criteria,
 		/// only with slightly more overhead.
 		/// </summary>
 		public Sort():this(SortField.FIELD_SCORE)
 		{
 		}
 		
-		/// <summary> Sorts by the terms in <c>field</c> then by index order (document
-		/// number). The type of value in <c>field</c> is determined
-		/// automatically.
-		/// 
-		/// </summary>
-		/// <seealso cref="SortField.AUTO">
-		/// </seealso>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating a <see cref="SortField" /> and then use <see cref="Sort(SortField)" />
-		///
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating a SortField and then use Sort(SortField)")]
-		public Sort(System.String field)
-		{
-			SetSort(field, false);
-		}
-		
-		/// <summary> Sorts possibly in reverse by the terms in <c>field</c> then by
-		/// index order (document number). The type of value in <c>field</c> is
-		/// determined automatically.
-		/// 
-		/// </summary>
-		/// <seealso cref="SortField.AUTO">
-		/// </seealso>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating a <see cref="SortField" /> and then use <see cref="Sort(SortField)" />
-		///
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating a SortField and then use Sort(SortField)")]
-		public Sort(System.String field, bool reverse)
-		{
-			SetSort(field, reverse);
-		}
-		
-		/// <summary> Sorts in succession by the terms in each field. The type of value in
-		/// <c>field</c> is determined automatically.
-		/// 
-		/// </summary>
-		/// <seealso cref="SortField.AUTO">
-		/// </seealso>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating <see cref="SortField" />s and then use <see cref="Sort(SortField[])" />
-		///
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating SortFields and then use Sort(SortField[])")]
-		public Sort(System.String[] fields)
-		{
-			SetSort(fields);
-		}
-		
 		/// <summary>Sorts by the criteria in the given SortField. </summary>
 		public Sort(SortField field)
 		{
@@ -181,54 +128,11 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Sorts in succession by the criteria in each SortField. </summary>
-		public Sort(SortField[] fields)
+		public Sort(params SortField[] fields)
 		{
 			SetSort(fields);
 		}
 		
-		/// <summary> Sets the sort to the terms in <c>field</c> then by index order
-		/// (document number).
-		/// </summary>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating a <see cref="SortField" /> and then use <see cref="SetSort(SortField)" />
-		///
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating a SortField and then use SetSort(SortField)")]
-		public void  SetSort(System.String field)
-		{
-			SetSort(field, false);
-		}
-		
-		/// <summary> Sets the sort to the terms in <c>field</c> possibly in reverse,
-		/// then by index order (document number).
-		/// </summary>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating a <see cref="SortField" /> and then use <see cref="SetSort(SortField)" />
-		///
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating a SortField and then use SetSort(SortField)")]
-		public virtual void  SetSort(System.String field, bool reverse)
-		{
-			fields = new SortField[]{new SortField(field, SortField.AUTO, reverse)};
-		}
-		
-		/// <summary>Sets the sort to the terms in each field in succession.</summary>
-		/// <deprecated> Please specify the type explicitly by
-		/// first creating <see cref="SortField" />s and then use <see cref="SetSort(SortField[])" />
-		/// 
-		/// </deprecated>
-        [Obsolete("Please specify the type explicitly by first creating a SortFields and then use SetSort(SortField[])")]
-		public virtual void  SetSort(System.String[] fieldnames)
-		{
-			int n = fieldnames.Length;
-			SortField[] nfields = new SortField[n];
-			for (int i = 0; i < n; ++i)
-			{
-				nfields[i] = new SortField(fieldnames[i], SortField.AUTO);
-			}
-			fields = nfields;
-		}
-		
 		/// <summary>Sets the sort to the given criteria. </summary>
 		public virtual void  SetSort(SortField field)
 		{
@@ -236,7 +140,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Sets the sort to the given criteria in succession. </summary>
-		public virtual void  SetSort(SortField[] fields)
+		public virtual void  SetSort(params SortField[] fields)
 		{
 			this.fields = fields;
 		}
@@ -300,7 +204,7 @@ namespace Lucene.Net.Search
 			// TODO in Java 1.5: switch to Arrays.hashCode().  The 
 			// Java 1.4 workaround below calculates the same hashCode
 			// as Java 1.5's new Arrays.hashCode()
-			return 0x45aaf665 + SupportClass.EquatableList<SortField>.GetHashCode(fields);
+			return 0x45aaf665 + EquatableList<SortField>.GetHashCode(fields);
 		}
 		static Sort()
 		{

Modified: incubator/lucene.net/trunk/src/core/Search/SortField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/SortField.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/SortField.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/SortField.cs Tue Feb 28 22:43:08 2012
@@ -16,9 +16,10 @@
  */
 
 using System;
-
+using Lucene.Net.Support;
 using NumericField = Lucene.Net.Documents.NumericField;
 using IndexReader = Lucene.Net.Index.IndexReader;
+using Single = Lucene.Net.Support.Single;
 using Term = Lucene.Net.Index.Term;
 using TermEnum = Lucene.Net.Index.TermEnum;
 using StringHelper = Lucene.Net.Util.StringHelper;
@@ -30,18 +31,11 @@ namespace Lucene.Net.Search
 	/// field.  Fields must be indexed in order to sort by them.
 	/// 
 	/// <p/>Created: Feb 11, 2004 1:25:29 PM
-	/// 
 	/// </summary>
-	/// <since>   lucene 1.4
-	/// </since>
-	/// <version>  $Id: SortField.java 801344 2009-08-05 18:05:06Z yonik $
-	/// </version>
-	/// <seealso cref="Sort">
-	/// </seealso>
+	/// <seealso cref="Sort"></seealso>
 	[Serializable]
 	public class SortField
 	{
-		
 		/// <summary>Sort by document score (relevancy).  Sort values are Float and higher
 		/// values are at the front. 
 		/// </summary>
@@ -52,17 +46,7 @@ namespace Lucene.Net.Search
 		/// </summary>
 		public const int DOC = 1;
 		
-		/// <summary>Guess type of sort based on field contents.  A regular expression is used
-		/// to look at the first term indexed for the field and determine if it
-		/// represents an integer number, a floating point number, or just arbitrary
-		/// string characters.
-		/// </summary>
-		/// <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.")]
-		public const int AUTO = 2;
+		// reserved, in Lucene 2.9, there was a constant: AUTO = 2
 		
 		/// <summary>Sort using term values as Strings.  Sort values are String and lower
 		/// values are at the front. 
@@ -122,47 +106,14 @@ namespace Lucene.Net.Search
 		public static readonly SortField FIELD_DOC = new SortField(null, DOC);
 		
 		private System.String field;
-		private int type = AUTO; // defaults to determining type dynamically
+		private int type; // defaults to determining type dynamically
 		private System.Globalization.CultureInfo locale; // defaults to "natural order" (no Locale)
 		internal bool reverse = false; // defaults to natural order
-		private SortComparatorSource factory;
 		private Lucene.Net.Search.Parser parser;
 		
 		// Used for CUSTOM sort
 		private FieldComparatorSource comparatorSource;
 		
-		private bool useLegacy = false; // remove in Lucene 3.0
-		
-		/// <summary>Creates a sort by terms in the given field where the type of term value
-		/// is determined dynamically (<see cref="AUTO" />).
-		/// </summary>
-		/// <param name="field">Name of field to sort by, cannot be
-		/// <c>null</c>.
-		/// </param>
-		/// <deprecated> Please specify the exact type instead.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type instead.")]
-		public SortField(System.String field)
-		{
-			InitFieldType(field, AUTO);
-		}
-		
-		/// <summary>Creates a sort, possibly in reverse, by terms in the given field where
-		/// the type of term value is determined dynamically (<see cref="AUTO" />).
-		/// </summary>
-		/// <param name="field">Name of field to sort by, cannot be <c>null</c>.
-		/// </param>
-		/// <param name="reverse">True if natural order should be reversed.
-		/// </param>
-		/// <deprecated> Please specify the exact type instead.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type instead.")]
-		public SortField(System.String field, bool reverse)
-		{
-			InitFieldType(field, AUTO);
-			this.reverse = reverse;
-		}
-		
 		/// <summary>Creates a sort by terms in the given field with the type of term
 		/// values explicitly given.
 		/// </summary>
@@ -279,21 +230,6 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="comparator">Returns a comparator for sorting hits.
 		/// </param>
-		/// <deprecated> use SortField (String field, FieldComparatorSource comparator)
-		/// </deprecated>
-        [Obsolete("use SortField (String field, FieldComparatorSource comparator)")]
-		public SortField(System.String field, SortComparatorSource comparator)
-		{
-			InitFieldType(field, CUSTOM);
-			SetUseLegacySearch(true);
-			this.factory = comparator;
-		}
-		
-		/// <summary>Creates a sort with a custom comparison function.</summary>
-		/// <param name="field">Name of field to sort by; cannot be <c>null</c>.
-		/// </param>
-		/// <param name="comparator">Returns a comparator for sorting hits.
-		/// </param>
 		public SortField(System.String field, FieldComparatorSource comparator)
 		{
 			InitFieldType(field, CUSTOM);
@@ -307,24 +243,6 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="reverse">True if natural order should be reversed.
 		/// </param>
-		/// <deprecated> use SortField (String field, FieldComparatorSource comparator, boolean reverse)
-		/// </deprecated>
-        [Obsolete("use SortField(String field, FieldComparatorSource comparator, boolean reverse)")]
-		public SortField(System.String field, SortComparatorSource comparator, bool reverse)
-		{
-			InitFieldType(field, CUSTOM);
-			SetUseLegacySearch(true);
-			this.reverse = reverse;
-			this.factory = comparator;
-		}
-		
-		/// <summary>Creates a sort, possibly in reverse, with a custom comparison function.</summary>
-		/// <param name="field">Name of field to sort by; cannot be <c>null</c>.
-		/// </param>
-		/// <param name="comparator">Returns a comparator for sorting hits.
-		/// </param>
-		/// <param name="reverse">True if natural order should be reversed.
-		/// </param>
 		public SortField(System.String field, FieldComparatorSource comparator, bool reverse)
 		{
 			InitFieldType(field, CUSTOM);
@@ -359,7 +277,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Returns the type of contents in the field.</summary>
-		/// <returns> One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT.
+		/// <returns> One of the constants SCORE, DOC, STRING, INT or FLOAT.
 		/// </returns>
 		public new virtual int GetType()
 		{
@@ -394,44 +312,15 @@ namespace Lucene.Net.Search
 			return reverse;
 		}
 		
-		/// <deprecated> use <see cref="GetComparatorSource()" />
-		/// </deprecated>
-        [Obsolete("use GetComparatorSource()")]
-		public virtual SortComparatorSource GetFactory()
-		{
-			return factory;
-		}
-		
+		/// <summary>
+		/// Returns the <see cref="FieldComparatorSource"/> used for
+		/// custom sorting
+		/// </summary>
 		public virtual FieldComparatorSource GetComparatorSource()
 		{
 			return comparatorSource;
 		}
 		
-		/// <summary> Use legacy IndexSearch implementation: search with a DirectoryReader rather
-		/// than passing a single hit collector to multiple SegmentReaders.
-		/// 
-		/// </summary>
-		/// <param name="legacy">true for legacy behavior
-		/// </param>
-		/// <deprecated> will be removed in Lucene 3.0.
-		/// </deprecated>
-        [Obsolete("will be removed in Lucene 3.0.")]
-		public virtual void  SetUseLegacySearch(bool legacy)
-		{
-			this.useLegacy = legacy;
-		}
-		
-		/// <returns> if true, IndexSearch will use legacy sorting search implementation.
-		/// eg. multiple Priority Queues.
-		/// </returns>
-		/// <deprecated> will be removed in Lucene 3.0.
-		/// </deprecated>
-        [Obsolete("will be removed in Lucene 3.0.")]
-		public virtual bool GetUseLegacySearch()
-		{
-			return this.useLegacy;
-		}
-		
 		public override System.String ToString()
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
@@ -442,62 +331,46 @@ namespace Lucene.Net.Search
 					buffer.Append("<score>");
 					break;
 				
-				
 				case DOC: 
 					buffer.Append("<doc>");
 					break;
 				
-				
-				case AUTO: 
-					buffer.Append("<auto: \"").Append(field).Append("\">");
-					break;
-				
-				
 				case STRING: 
 					buffer.Append("<string: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case STRING_VAL: 
 					buffer.Append("<string_val: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case BYTE: 
 					buffer.Append("<byte: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case SHORT: 
 					buffer.Append("<short: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case INT: 
 					buffer.Append("<int: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case LONG: 
 					buffer.Append("<long: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case FLOAT: 
 					buffer.Append("<float: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case DOUBLE: 
 					buffer.Append("<double: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case CUSTOM: 
-					buffer.Append("<custom:\"").Append(field).Append("\": ").Append(factory).Append('>');
+					buffer.Append("<custom:\"").Append(field).Append("\": ").Append(comparatorSource).Append('>');
 					break;
 				
-				
 				default: 
 					buffer.Append("<???: \"").Append(field).Append("\">");
 					break;
@@ -515,7 +388,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Returns true if <c>o</c> is equal to this.  If a
-		/// <see cref="SortComparatorSource" /> (deprecated) or <see cref="Parser" />
+		/// <see cref="FieldComparatorSource" />  or <see cref="Parser" />
 		/// was provided, it must properly
 		/// implement equals (unless a singleton is always used). 
 		/// </summary>
@@ -526,11 +399,17 @@ namespace Lucene.Net.Search
 			if (!(o is SortField))
 				return false;
 			SortField other = (SortField) o;
-			return ((System.Object) other.field == (System.Object) this.field && other.type == this.type && other.reverse == this.reverse && (other.locale == null?this.locale == null:other.locale.Equals(this.locale)) && (other.factory == null?this.factory == null:other.factory.Equals(this.factory)) && (other.comparatorSource == null?this.comparatorSource == null:other.comparatorSource.Equals(this.comparatorSource)) && (other.parser == null?this.parser == null:other.parser.Equals(this.parser)));
+		    return ((System.Object) other.field == (System.Object) this.field && other.type == this.type &&
+		            other.reverse == this.reverse &&
+		            (other.locale == null ? this.locale == null : other.locale.Equals(this.locale)) &&
+		            (other.comparatorSource == null
+		                 ? this.comparatorSource == null
+		                 : other.comparatorSource.Equals(this.comparatorSource)) &&
+		            (other.parser == null ? this.parser == null : other.parser.Equals(this.parser)));
 		}
 		
 		/// <summary>Returns true if <c>o</c> is equal to this.  If a
-		/// <see cref="SortComparatorSource" /> (deprecated) or <see cref="Parser" />
+		/// <see cref="FieldComparatorSource" /> (deprecated) or <see cref="Parser" />
 		/// was provided, it must properly
 		/// implement hashCode (unless a singleton is always
 		/// used). 
@@ -544,8 +423,6 @@ namespace Lucene.Net.Search
 			{
 				hash += (locale.GetHashCode() ^ 0x08150815);
 			}
-			if (factory != null)
-				hash += (factory.GetHashCode() ^ 0x34987555);
 			if (comparatorSource != null)
 				hash += comparatorSource.GetHashCode();
 			if (parser != null)
@@ -596,94 +473,44 @@ namespace Lucene.Net.Search
 			
 			switch (type)
 			{
-				
 				case SortField.SCORE: 
 					return new FieldComparator.RelevanceComparator(numHits);
 				
-				
 				case SortField.DOC: 
 					return new FieldComparator.DocComparator(numHits);
 				
-				
 				case SortField.INT: 
 					return new FieldComparator.IntComparator(numHits, field, parser);
 				
-				
 				case SortField.FLOAT: 
 					return new FieldComparator.FloatComparator(numHits, field, parser);
 				
-				
 				case SortField.LONG: 
 					return new FieldComparator.LongComparator(numHits, field, parser);
 				
-				
 				case SortField.DOUBLE: 
 					return new FieldComparator.DoubleComparator(numHits, field, parser);
 				
-				
 				case SortField.BYTE: 
 					return new FieldComparator.ByteComparator(numHits, field, parser);
 				
-				
 				case SortField.SHORT: 
 					return new FieldComparator.ShortComparator(numHits, field, parser);
 				
-				
 				case SortField.CUSTOM: 
-					System.Diagnostics.Debug.Assert(factory == null && comparatorSource != null);
+					System.Diagnostics.Debug.Assert(comparatorSource != null);
 					return comparatorSource.NewComparator(field, numHits, sortPos, reverse);
 				
-				
 				case SortField.STRING: 
 					return new FieldComparator.StringOrdValComparator(numHits, field, sortPos, reverse);
 				
-				
 				case SortField.STRING_VAL: 
 					return new FieldComparator.StringValComparator(numHits, field);
 				
-				
 				default: 
 					throw new System.SystemException("Illegal sort type: " + type);
 				
 			}
 		}
-		
-		/// <summary> Attempts to detect the given field type for an IndexReader.</summary>
-		/// <deprecated>
-		/// </deprecated>
-        [Obsolete]
-		internal static int DetectFieldType(IndexReader reader, System.String fieldKey)
-		{
-			System.String field = StringHelper.Intern(fieldKey);
-			TermEnum enumerator = reader.Terms(new Term(field));
-			try
-			{
-				Term term = enumerator.Term();
-				if (term == null)
-				{
-					throw new System.SystemException("no terms in field " + field + " - cannot determine sort type");
-				}
-				int ret = 0;
-				if ((System.Object) term.Field() == (System.Object) field)
-				{
-					System.String termtext = term.Text().Trim();
-                    
-                    int tmpI32; long tmpI64; float tmpF;
-                    if      (System.Int32.TryParse(termtext, out tmpI32))       ret = SortField.INT;
-                    else if (System.Int64.TryParse(termtext, out tmpI64))       ret = SortField.LONG;
-                    else if (SupportClass.Single.TryParse(termtext, out tmpF))  ret = SortField.FLOAT;
-                    else ret = SortField.STRING;
-				}
-				else
-				{
-					throw new System.SystemException("field \"" + field + "\" does not appear to be indexed");
-				}
-				return ret;
-			}
-			finally
-			{
-				enumerator.Close();
-			}
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/SpanFilterResult.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/SpanFilterResult.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/SpanFilterResult.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/SpanFilterResult.cs Tue Feb 28 22:43:08 2012
@@ -16,48 +16,26 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Search
 {
-	
-	
 	/// <summary>  The results of a SpanQueryFilter.  Wraps the BitSet and the position information from the SpanQuery
 	/// 
 	/// <p/>
 	/// NOTE: This API is still experimental and subject to change. 
-	/// 
-	/// 
 	/// </summary>
 	public class SpanFilterResult
 	{
-		/// <deprecated> 
-		/// </deprecated>
-        [Obsolete]
-		private System.Collections.BitArray bits;
-		
 		private DocIdSet docIdSet;
-		private System.Collections.IList positions; //Spans spans;
-		
-		/// <summary> </summary>
-		/// <param name="bits">The bits for the Filter
-		/// </param>
-		/// <param name="positions">A List of <see cref="Lucene.Net.Search.SpanFilterResult.PositionInfo" /> objects
-		/// </param>
-        /// <deprecated> Use <see cref="SpanFilterResult(DocIdSet, System.Collections.IList)" /> instead
-		/// </deprecated>
-        [Obsolete("Use SpanFilterResult(DocIdSet, List) instead")]
-		public SpanFilterResult(System.Collections.BitArray bits, System.Collections.IList positions)
-		{
-			this.bits = bits;
-			this.positions = positions;
-		}
+		private IList<PositionInfo> positions; //Spans spans;
 		
 		/// <summary> </summary>
 		/// <param name="docIdSet">The DocIdSet for the Filter
 		/// </param>
 		/// <param name="positions">A List of <see cref="Lucene.Net.Search.SpanFilterResult.PositionInfo" /> objects
 		/// </param>
-		public SpanFilterResult(DocIdSet docIdSet, System.Collections.IList positions)
+		public SpanFilterResult(DocIdSet docIdSet, IList<PositionInfo> positions)
 		{
 			this.docIdSet = docIdSet;
 			this.positions = positions;
@@ -68,19 +46,11 @@ namespace Lucene.Net.Search
 		/// </summary>
 		/// <returns> A List of PositionInfo objects
 		/// </returns>
-		public virtual System.Collections.IList GetPositions()
+        public virtual IList<PositionInfo> GetPositions()
 		{
 			return positions;
 		}
 		
-		/// <deprecated> Use <see cref="GetDocIdSet()" />
-		/// </deprecated>
-        [Obsolete("Use GetDocIdSet()")]
-		public virtual System.Collections.BitArray GetBits()
-		{
-			return bits;
-		}
-		
 		/// <summary>Returns the docIdSet </summary>
 		public virtual DocIdSet GetDocIdSet()
 		{
@@ -90,13 +60,13 @@ namespace Lucene.Net.Search
 		public class PositionInfo
 		{
 			private int doc;
-			private System.Collections.IList positions;
+            private IList<StartEnd> positions;
 			
 			
 			public PositionInfo(int doc)
 			{
 				this.doc = doc;
-				positions = new System.Collections.ArrayList();
+				positions = new List<StartEnd>();
 			}
 			
 			public virtual void  AddPosition(int start, int end)
@@ -112,7 +82,7 @@ namespace Lucene.Net.Search
 			/// <summary> </summary>
 			/// <returns> A List of <see cref="Lucene.Net.Search.SpanFilterResult.StartEnd" /> objects
 			/// </returns>
-			public virtual System.Collections.IList GetPositions()
+            public virtual IList<StartEnd> GetPositions()
 			{
 				return positions;
 			}

Modified: incubator/lucene.net/trunk/src/core/Search/SpanQueryFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/SpanQueryFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/SpanQueryFilter.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/SpanQueryFilter.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using System.Collections.Generic;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using OpenBitSet = Lucene.Net.Util.OpenBitSet;
 using SpanQuery = Lucene.Net.Search.Spans.SpanQuery;
@@ -67,7 +67,7 @@ namespace Lucene.Net.Search
 			
 			OpenBitSet bits = new OpenBitSet(reader.MaxDoc());
 			Lucene.Net.Search.Spans.Spans spans = query.GetSpans(reader);
-			System.Collections.IList tmp = new System.Collections.ArrayList(20);
+			IList<SpanFilterResult.PositionInfo> tmp = new List<SpanFilterResult.PositionInfo>(20);
 			int currentDoc = - 1;
 			SpanFilterResult.PositionInfo currentInfo = null;
 			while (spans.Next())

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/FieldMaskingSpanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/FieldMaskingSpanQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/FieldMaskingSpanQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/FieldMaskingSpanQuery.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using Lucene.Net.Index;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using ToStringUtils = Lucene.Net.Util.ToStringUtils;
 using Query = Lucene.Net.Search.Query;
@@ -98,15 +98,7 @@ namespace Lucene.Net.Search.Spans
 			return maskedQuery.GetSpans(reader);
 		}
 		
-		/// <deprecated> use <see cref="ExtractTerms(System.Collections.Hashtable)" /> instead. 
-		/// </deprecated>
-        [Obsolete("use ExtractTerms(Hashtable) instead.")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			return maskedQuery.GetTerms();
-		}
-		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
 			maskedQuery.ExtractTerms(terms);
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/NearSpansUnordered.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/NearSpansUnordered.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/NearSpansUnordered.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/NearSpansUnordered.cs Tue Feb 28 22:43:08 2012
@@ -16,9 +16,9 @@
  */
 
 using System;
-
+using System.Linq;
+using Lucene.Net.Util;
 using IndexReader = Lucene.Net.Index.IndexReader;
-using PriorityQueue = Lucene.Net.Util.PriorityQueue;
 
 namespace Lucene.Net.Search.Spans
 {
@@ -28,11 +28,11 @@ namespace Lucene.Net.Search.Spans
 	/// Expert:
 	/// Only public for subclassing.  Most implementations should not need this class
 	/// </summary>
-	public class NearSpansUnordered:Spans
+	public class NearSpansUnordered : Spans
 	{
 		private SpanNearQuery query;
 		
-		private System.Collections.IList ordered = new System.Collections.ArrayList(); // spans in query order
+		private System.Collections.Generic.IList<SpansCell> ordered = new System.Collections.Generic.List<SpansCell>(); // spans in query order
 		private Spans[] subSpans;
 		private int slop; // from query
 		
@@ -47,7 +47,7 @@ namespace Lucene.Net.Search.Spans
 		private bool more = true; // true iff not done
 		private bool firstTime = true; // true before first next()
 		
-		private class CellQueue:PriorityQueue
+		private class CellQueue : PriorityQueue<SpansCell>
 		{
 			private void  InitBlock(NearSpansUnordered enclosingInstance)
 			{
@@ -67,11 +67,9 @@ namespace Lucene.Net.Search.Spans
 				InitBlock(enclosingInstance);
 				Initialize(size);
 			}
-			
-			public override bool LessThan(System.Object o1, System.Object o2)
+
+            public override bool LessThan(SpansCell spans1, SpansCell spans2)
 			{
-				SpansCell spans1 = (SpansCell) o1;
-				SpansCell spans2 = (SpansCell) o2;
 				if (spans1.Doc() == spans2.Doc())
 				{
 					return NearSpansOrdered.DocSpansOrdered(spans1, spans2);
@@ -157,7 +155,7 @@ namespace Lucene.Net.Search.Spans
 			// TODO: Remove warning after API has been finalized
 			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
-				return spans.GetPayload();
+				return spans.GetPayload().ToArray();
 			}
 			
 			// TODO: Remove warning after API has been finalized
@@ -205,7 +203,7 @@ namespace Lucene.Net.Search.Spans
 				if (Min().Next())
 				{
 					// trigger further scanning
-					queue.AdjustTop(); // maintain queue
+					queue.UpdateTop(); // maintain queue
 				}
 				else
 				{
@@ -254,7 +252,7 @@ namespace Lucene.Net.Search.Spans
 				more = Min().Next();
 				if (more)
 				{
-					queue.AdjustTop(); // maintain queue
+					queue.UpdateTop(); // maintain queue
 				}
 			}
 			return false; // no more matches
@@ -284,7 +282,7 @@ namespace Lucene.Net.Search.Spans
 					// skip as needed
 					if (Min().SkipTo(target))
 					{
-						queue.AdjustTop();
+						queue.UpdateTop();
 					}
 					else
 					{
@@ -297,7 +295,7 @@ namespace Lucene.Net.Search.Spans
 		
 		private SpansCell Min()
 		{
-			return (SpansCell) queue.Top();
+			return queue.Top();
 		}
 		
 		public override int Doc()
@@ -320,23 +318,15 @@ namespace Lucene.Net.Search.Spans
 		/// <throws>  IOException </throws>
 		public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 		{
-            //mgarski: faking out another HashSet<T>...
-			System.Collections.Generic.Dictionary<byte[], byte[]> matchPayload = new System.Collections.Generic.Dictionary<byte[], byte[]>(); 
+			System.Collections.Generic.ISet<byte[]> matchPayload = new System.Collections.Generic.HashSet<byte[]>(); 
 			for (SpansCell cell = first; cell != null; cell = cell.next)
 			{
 				if (cell.IsPayloadAvailable())
 				{
-                    System.Collections.Generic.ICollection<byte[]> cellPayload = cell.GetPayload();
-                    foreach (byte[] val in cellPayload)
-                    {
-                        if (!matchPayload.ContainsKey(val))
-                        {
-                            matchPayload.Add(val, val);
-                        }
-                    }
+                    matchPayload.UnionWith(cell.GetPayload());
 				}
 			}
-			return matchPayload.Keys;
+			return matchPayload;
 		}
 		
 		// TODO: Remove warning after API has been finalized
@@ -364,7 +354,7 @@ namespace Lucene.Net.Search.Spans
 		{
 			for (int i = 0; more && i < ordered.Count; i++)
 			{
-				SpansCell cell = (SpansCell) ordered[i];
+				SpansCell cell = ordered[i];
 				if (next)
 					more = cell.Next(); // move to first entry
 				if (more)
@@ -400,7 +390,7 @@ namespace Lucene.Net.Search.Spans
 			last = first = null;
 			while (queue.Top() != null)
 			{
-				AddToList((SpansCell) queue.Pop());
+				AddToList(queue.Pop());
 			}
 		}
 		
@@ -409,7 +399,7 @@ namespace Lucene.Net.Search.Spans
 			queue.Clear(); // rebuild queue
 			for (SpansCell cell = first; cell != null; cell = cell.next)
 			{
-				queue.Put(cell); // add to queue from list
+				queue.Add(cell); // add to queue from list
 			}
 		}
 		

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanFirstQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanFirstQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanFirstQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanFirstQuery.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;
 using ToStringUtils = Lucene.Net.Util.ToStringUtils;
 using Query = Lucene.Net.Search.Query;
@@ -26,7 +27,7 @@ namespace Lucene.Net.Search.Spans
 	
 	/// <summary>Matches spans near the beginning of a field. </summary>
 	[Serializable]
-	public class SpanFirstQuery:SpanQuery, System.ICloneable
+	public class SpanFirstQuery : SpanQuery, System.ICloneable
 	{
 		private class AnonymousClassSpans : Spans
 		{
@@ -135,17 +136,6 @@ namespace Lucene.Net.Search.Spans
 			return match.GetField();
 		}
 		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-        /// <seealso cref="ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use ExtractTerms instead")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			return match.GetTerms();
-		}
-		
 		public override System.String ToString(System.String field)
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
@@ -165,7 +155,7 @@ namespace Lucene.Net.Search.Spans
 			return spanFirstQuery;
 		}
 		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
 			match.ExtractTerms(terms);
 		}
@@ -210,7 +200,7 @@ namespace Lucene.Net.Search.Spans
 		public override int GetHashCode()
 		{
 			int h = match.GetHashCode();
-			h ^= ((h << 8) | (SupportClass.Number.URShift(h, 25))); // reversible
+			h ^= ((h << 8) | (Number.URShift(h, 25))); // reversible
 			h ^= System.Convert.ToInt32(GetBoost()) ^ end;
 			return h;
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanNearQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanNearQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanNearQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanNearQuery.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,9 @@
  */
 
 using System;
-
+using System.Linq;
+using Lucene.Net.Index;
+using Lucene.Net.Support;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using ToStringUtils = Lucene.Net.Util.ToStringUtils;
 using Query = Lucene.Net.Search.Query;
@@ -29,9 +31,9 @@ namespace Lucene.Net.Search.Spans
 	/// matches are required to be in-order. 
 	/// </summary>
 	[Serializable]
-	public class SpanNearQuery:SpanQuery, System.ICloneable
+	public class SpanNearQuery : SpanQuery, System.ICloneable
 	{
-		protected internal System.Collections.ArrayList clauses;
+		protected internal System.Collections.Generic.IList<SpanQuery> clauses;
 		protected internal int slop;
 		protected internal bool inOrder;
 		
@@ -51,7 +53,7 @@ namespace Lucene.Net.Search.Spans
 		{
 			
 			// copy clauses array into an ArrayList
-			this.clauses = new System.Collections.ArrayList(clauses.Length);
+			this.clauses = new System.Collections.Generic.List<SpanQuery>(clauses.Length);
 			for (int i = 0; i < clauses.Length; i++)
 			{
 				SpanQuery clause = clauses[i];
@@ -74,7 +76,7 @@ namespace Lucene.Net.Search.Spans
 		/// <summary>Return the clauses whose spans are matched. </summary>
 		public virtual SpanQuery[] GetClauses()
 		{
-			return (SpanQuery[]) clauses.ToArray(typeof(SpanQuery));
+			return clauses.ToArray();
 		}
 		
 		/// <summary>Return the maximum number of intervening unmatched positions permitted.</summary>
@@ -94,25 +96,7 @@ namespace Lucene.Net.Search.Spans
 			return field;
 		}
 		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-        /// <seealso cref="ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use ExtractTerms instead")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			System.Collections.ArrayList terms = new System.Collections.ArrayList();
-			System.Collections.IEnumerator i = clauses.GetEnumerator();
-			while (i.MoveNext())
-			{
-				SpanQuery clause = (SpanQuery) i.Current;
-				terms.AddRange(clause.GetTerms());
-			}
-			return terms;
-		}
-		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
             foreach (SpanQuery clause in clauses)
             {
@@ -125,10 +109,10 @@ namespace Lucene.Net.Search.Spans
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
 			buffer.Append("spanNear([");
-			System.Collections.IEnumerator i = clauses.GetEnumerator();
+			System.Collections.Generic.IEnumerator<SpanQuery> i = clauses.GetEnumerator();
 			while (i.MoveNext())
 			{
-				SpanQuery clause = (SpanQuery) i.Current;
+				SpanQuery clause = i.Current;
 				buffer.Append(clause.ToString(field));
                 buffer.Append(", ");
 			}
@@ -150,7 +134,7 @@ namespace Lucene.Net.Search.Spans
 			
 			if (clauses.Count == 1)
 			// optimize 1-clause case
-				return ((SpanQuery) clauses[0]).GetSpans(reader);
+				return clauses[0].GetSpans(reader);
 			
 			return inOrder?(Spans) new NearSpansOrdered(this, reader, collectPayloads):(Spans) new NearSpansUnordered(this, reader);
 		}
@@ -160,7 +144,7 @@ namespace Lucene.Net.Search.Spans
 			SpanNearQuery clone = null;
 			for (int i = 0; i < clauses.Count; i++)
 			{
-				SpanQuery c = (SpanQuery) clauses[i];
+				SpanQuery c = clauses[i];
 				SpanQuery query = (SpanQuery) c.Rewrite(reader);
 				if (query != c)
 				{
@@ -187,7 +171,7 @@ namespace Lucene.Net.Search.Spans
 			
 			for (int i = 0; i < sz; i++)
 			{
-				SpanQuery clause = (SpanQuery) clauses[i];
+				SpanQuery clause = clauses[i];
 				newClauses[i] = (SpanQuery) clause.Clone();
 			}
 			SpanNearQuery spanNearQuery = new SpanNearQuery(newClauses, slop, inOrder);
@@ -236,7 +220,7 @@ namespace Lucene.Net.Search.Spans
 			// Mix bits before folding in things like boost, since it could cancel the
 			// last element of clauses.  This particular mix also serves to
 			// differentiate SpanNearQuery hashcodes from others.
-			result ^= ((result << 14) | (SupportClass.Number.URShift(result, 19))); // reversible
+			result ^= ((result << 14) | (Number.URShift(result, 19))); // reversible
 			result += System.Convert.ToInt32(GetBoost());
 			result += slop;
 			result ^= (inOrder ? (long) 0x99AFD3BD : 0);

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanNotQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanNotQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanNotQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanNotQuery.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;
 using ToStringUtils = Lucene.Net.Util.ToStringUtils;
 using Query = Lucene.Net.Search.Query;
@@ -174,18 +175,7 @@ namespace Lucene.Net.Search.Spans
 			return include.GetField();
 		}
 		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-        /// <seealso cref="ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use ExtractTerms instead")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			return include.GetTerms();
-		}
-		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
 			include.ExtractTerms(terms);
 		}
@@ -257,9 +247,9 @@ namespace Lucene.Net.Search.Spans
 		public override int GetHashCode()
 		{
 			int h = include.GetHashCode();
-			h = (h << 1) | (SupportClass.Number.URShift(h, 31)); // rotate left
+			h = (h << 1) | (Number.URShift(h, 31)); // rotate left
 			h ^= exclude.GetHashCode();
-			h = (h << 1) | (SupportClass.Number.URShift(h, 31)); // rotate left
+			h = (h << 1) | (Number.URShift(h, 31)); // rotate left
 			h ^= System.Convert.ToInt32(GetBoost());
 			return h;
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanOrQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanOrQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanOrQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanOrQuery.cs Tue Feb 28 22:43:08 2012
@@ -16,9 +16,10 @@
  */
 
 using System;
-
+using Lucene.Net.Index;
+using Lucene.Net.Support;
+using Lucene.Net.Util;
 using IndexReader = Lucene.Net.Index.IndexReader;
-using PriorityQueue = Lucene.Net.Util.PriorityQueue;
 using ToStringUtils = Lucene.Net.Util.ToStringUtils;
 using Query = Lucene.Net.Search.Query;
 
@@ -27,7 +28,7 @@ namespace Lucene.Net.Search.Spans
 	
 	/// <summary>Matches the union of its clauses.</summary>
 	[Serializable]
-	public class SpanOrQuery:SpanQuery, System.ICloneable
+	public class SpanOrQuery : SpanQuery, System.ICloneable
 	{
 		private class AnonymousClassSpans : Spans
 		{
@@ -55,13 +56,13 @@ namespace Lucene.Net.Search.Spans
 			private bool InitSpanQueue(int target)
 			{
 				queue = new SpanQueue(enclosingInstance, Enclosing_Instance.clauses.Count);
-				System.Collections.IEnumerator i = Enclosing_Instance.clauses.GetEnumerator();
+				System.Collections.Generic.IEnumerator<SpanQuery> i = Enclosing_Instance.clauses.GetEnumerator();
 				while (i.MoveNext())
 				{
-					Spans spans = ((SpanQuery) i.Current).GetSpans(reader);
+					Spans spans = i.Current.GetSpans(reader);
 					if (((target == - 1) && spans.Next()) || ((target != - 1) && spans.SkipTo(target)))
 					{
-						queue.Put(spans);
+						queue.Add(spans);
 					}
 				}
 				return queue.Size() != 0;
@@ -83,7 +84,7 @@ namespace Lucene.Net.Search.Spans
 				if (Top().Next())
 				{
 					// move to next
-					queue.AdjustTop();
+					queue.UpdateTop();
 					return true;
 				}
 				
@@ -93,7 +94,7 @@ namespace Lucene.Net.Search.Spans
 			
 			private Spans Top()
 			{
-				return (Spans) queue.Top();
+				return queue.Top();
 			}
 			
 			public override bool SkipTo(int target)
@@ -108,7 +109,7 @@ namespace Lucene.Net.Search.Spans
 				{
 					if (Top().SkipTo(target))
 					{
-						queue.AdjustTop();
+						queue.UpdateTop();
 					}
 					else
 					{
@@ -137,7 +138,6 @@ namespace Lucene.Net.Search.Spans
 				return Top().End();
 			}
 			
-			// TODO: Remove warning after API has been finalized
 			public override System.Collections.Generic.ICollection<byte[]> GetPayload()
 			{
 				System.Collections.Generic.ICollection<byte[]> result = null;
@@ -149,7 +149,6 @@ namespace Lucene.Net.Search.Spans
 				return result;
 			}
 			
-			// TODO: Remove warning after API has been finalized
 			public override bool IsPayloadAvailable()
 			{
 				Spans top = Top();
@@ -161,15 +160,16 @@ namespace Lucene.Net.Search.Spans
 				return "spans(" + Enclosing_Instance + ")@" + ((queue == null)?"START":(queue.Size() > 0?(Doc() + ":" + Start() + "-" + End()):"END"));
 			}
 		}
-		private SupportClass.EquatableList<SpanQuery> clauses;
+
+		private EquatableList<SpanQuery> clauses;
 		private System.String field;
 		
 		/// <summary>Construct a SpanOrQuery merging the provided clauses. </summary>
-		public SpanOrQuery(SpanQuery[] clauses)
+		public SpanOrQuery(params SpanQuery[] clauses)
 		{
 			
 			// copy clauses array into an ArrayList
-			this.clauses = new SupportClass.EquatableList<SpanQuery>(clauses.Length);
+			this.clauses = new EquatableList<SpanQuery>(clauses.Length);
 			for (int i = 0; i < clauses.Length; i++)
 			{
 				SpanQuery clause = clauses[i];
@@ -189,7 +189,7 @@ namespace Lucene.Net.Search.Spans
 		/// <summary>Return the clauses whose spans are matched. </summary>
 		public virtual SpanQuery[] GetClauses()
 		{
-			return (SpanQuery[]) clauses.ToArray();
+			return clauses.ToArray();
 		}
 		
 		public override System.String GetField()
@@ -197,30 +197,10 @@ namespace Lucene.Net.Search.Spans
 			return field;
 		}
 		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-        /// <seealso cref="ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use ExtractTerms instead")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			System.Collections.ArrayList terms = new System.Collections.ArrayList();
-			System.Collections.IEnumerator i = clauses.GetEnumerator();
-			while (i.MoveNext())
-			{
-				SpanQuery clause = (SpanQuery) i.Current;
-				terms.AddRange(clause.GetTerms());
-			}
-			return terms;
-		}
-		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
-			System.Collections.IEnumerator i = clauses.GetEnumerator();
-			while (i.MoveNext())
-			{
-				SpanQuery clause = (SpanQuery) i.Current;
+			foreach(SpanQuery clause in clauses)
+            {
 				clause.ExtractTerms(terms);
 			}
 		}
@@ -232,8 +212,7 @@ namespace Lucene.Net.Search.Spans
 			
 			for (int i = 0; i < sz; i++)
 			{
-				SpanQuery clause = (SpanQuery) clauses[i];
-				newClauses[i] = (SpanQuery) clause.Clone();
+                newClauses[i] = (SpanQuery) clauses[i].Clone();
 			}
 			SpanOrQuery soq = new SpanOrQuery(newClauses);
 			soq.SetBoost(GetBoost());
@@ -245,7 +224,7 @@ namespace Lucene.Net.Search.Spans
 			SpanOrQuery clone = null;
 			for (int i = 0; i < clauses.Count; i++)
 			{
-				SpanQuery c = (SpanQuery) clauses[i];
+				SpanQuery c = clauses[i];
 				SpanQuery query = (SpanQuery) c.Rewrite(reader);
 				if (query != c)
 				{
@@ -269,12 +248,12 @@ namespace Lucene.Net.Search.Spans
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
 			buffer.Append("spanOr([");
-			System.Collections.IEnumerator i = clauses.GetEnumerator();
+			System.Collections.Generic.IEnumerator<SpanQuery> i = clauses.GetEnumerator();
             int j = 0;
 			while (i.MoveNext())
 			{
                 j++;
-				SpanQuery clause = (SpanQuery) i.Current;
+				SpanQuery clause = i.Current;
 				buffer.Append(clause.ToString(field));
                 if (j < clauses.Count)
                 {
@@ -306,13 +285,13 @@ namespace Lucene.Net.Search.Spans
 		public override int GetHashCode()
 		{
 			int h = clauses.GetHashCode();
-			h ^= ((h << 10) | (SupportClass.Number.URShift(h, 23)));
+			h ^= ((h << 10) | (Number.URShift(h, 23)));
 			h ^= System.Convert.ToInt32(GetBoost());
 			return h;
 		}
 		
 		
-		private class SpanQueue:PriorityQueue
+		private class SpanQueue : PriorityQueue<Spans>
 		{
 			private void  InitBlock(SpanOrQuery enclosingInstance)
 			{
@@ -332,11 +311,9 @@ namespace Lucene.Net.Search.Spans
 				InitBlock(enclosingInstance);
 				Initialize(size);
 			}
-			
-			public override bool LessThan(System.Object o1, System.Object o2)
+
+            public override bool LessThan(Spans spans1, Spans spans2)
 			{
-				Spans spans1 = (Spans) o1;
-				Spans spans2 = (Spans) o2;
 				if (spans1.Doc() == spans2.Doc())
 				{
 					if (spans1.Start() == spans2.Start())
@@ -359,7 +336,7 @@ namespace Lucene.Net.Search.Spans
 		{
 			if (clauses.Count == 1)
 			// optimize 1-clause case
-				return ((SpanQuery) clauses[0]).GetSpans(reader);
+				return (clauses[0]).GetSpans(reader);
 			
 			return new AnonymousClassSpans(reader, this);
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanQuery.cs Tue Feb 28 22:43:08 2012
@@ -37,14 +37,6 @@ namespace Lucene.Net.Search.Spans
 		/// <summary>Returns the name of the field matched by this query.</summary>
 		public abstract System.String GetField();
 		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-		/// <seealso cref="Query.ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use ExtractTerms instead")]
-		public abstract System.Collections.ICollection GetTerms();
-		
 		public override Weight CreateWeight(Searcher searcher)
 		{
 			return new SpanWeight(this, searcher);

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanScorer.cs Tue Feb 28 22:43:08 2012
@@ -24,7 +24,6 @@ using Weight = Lucene.Net.Search.Weight;
 
 namespace Lucene.Net.Search.Spans
 {
-	
 	/// <summary> Public for extension only.</summary>
 	public class SpanScorer:Scorer
 	{
@@ -33,10 +32,6 @@ namespace Lucene.Net.Search.Spans
 		protected internal byte[] norms;
 		protected internal float value_Renamed;
 		
-		/// <deprecated> not needed anymore 
-		/// </deprecated>
-        [Obsolete("not needed anymore ")]
-		protected internal bool firstTime = true;
 		protected internal bool more = true;
 		
 		protected internal int doc;
@@ -59,14 +54,6 @@ namespace Lucene.Net.Search.Spans
 			}
 		}
 		
-		/// <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 (!SetFreqCurrentDoc())
@@ -76,14 +63,6 @@ namespace Lucene.Net.Search.Spans
 			return doc;
 		}
 		
-		/// <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 (!more)
@@ -120,14 +99,6 @@ namespace Lucene.Net.Search.Spans
 			return true;
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead. ")]
-		public override int Doc()
-		{
-			return doc;
-		}
-		
 		public override int DocID()
 		{
 			return doc;
@@ -139,15 +110,19 @@ namespace Lucene.Net.Search.Spans
 			return norms == null?raw:raw * Similarity.DecodeNorm(norms[doc]); // normalize
 		}
 		
-		public override Explanation Explain(int doc)
+        /// <summary>
+        /// This method is no longer an official member of <see cref="Scorer"/>
+        /// but it is needed by SpanWeight to build an explanation.
+        /// </summary>
+		protected internal virtual Explanation Explain(int doc)
 		{
 			Explanation tfExplanation = new Explanation();
 			
 			int expDoc = Advance(doc);
 			
 			float phraseFreq = (expDoc == doc)?freq:0.0f;
-			tfExplanation.SetValue(GetSimilarity().Tf(phraseFreq));
-			tfExplanation.SetDescription("tf(phraseFreq=" + phraseFreq + ")");
+			tfExplanation.Value = GetSimilarity().Tf(phraseFreq);
+			tfExplanation.Description = "tf(phraseFreq=" + phraseFreq + ")";
 			
 			return tfExplanation;
 		}

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanTermQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanTermQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanTermQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanTermQuery.cs Tue Feb 28 22:43:08 2012
@@ -46,22 +46,10 @@ namespace Lucene.Net.Search.Spans
 		{
 			return term.Field();
 		}
-		
-		/// <summary>Returns a collection of all terms matched by this query.</summary>
-		/// <deprecated> use extractTerms instead
-		/// </deprecated>
-        /// <seealso cref="ExtractTerms(System.Collections.Hashtable)">
-		/// </seealso>
-        [Obsolete("use extractTerms instead")]
-		public override System.Collections.ICollection GetTerms()
-		{
-			System.Collections.ArrayList terms = new System.Collections.ArrayList();
-			terms.Add(term);
-			return terms;
-		}
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
-			SupportClass.CollectionsHelper.AddIfNotContains(terms, term);
+		    terms.Add(term);
 		}
 		
 		public override System.String ToString(System.String field)

Modified: incubator/lucene.net/trunk/src/core/Search/Spans/SpanWeight.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/Spans/SpanWeight.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/Spans/SpanWeight.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/Spans/SpanWeight.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,8 @@
  */
 
 using System;
-
+using System.Collections.Generic;
+using Lucene.Net.Index;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using Lucene.Net.Search;
 using IDFExplanation = Lucene.Net.Search.Explanation.IDFExplanation;
@@ -33,8 +34,8 @@ namespace Lucene.Net.Search.Spans
 		protected internal float idf;
 		protected internal float queryNorm;
 		protected internal float queryWeight;
-		
-		protected internal System.Collections.Hashtable terms;
+
+        protected internal HashSet<Term> terms;
 		protected internal SpanQuery query;
 		private IDFExplanation idfExp;
 		
@@ -42,9 +43,11 @@ namespace Lucene.Net.Search.Spans
 		{
 			this.similarity = query.GetSimilarity(searcher);
 			this.query = query;
-			terms = new System.Collections.Hashtable();
+
+			terms = new HashSet<Term>();
 			query.ExtractTerms(terms);
-			idfExp = similarity.idfExplain(new System.Collections.ArrayList(terms.Values), searcher);
+
+			idfExp = similarity.IdfExplain(terms, searcher);
 			idf = idfExp.GetIdf();
 		}
 		
@@ -79,14 +82,14 @@ namespace Lucene.Net.Search.Spans
 		{
 			
 			ComplexExplanation result = new ComplexExplanation();
-			result.SetDescription("weight(" + GetQuery() + " in " + doc + "), product of:");
+			result.Description = "weight(" + GetQuery() + " in " + doc + "), product of:";
 			System.String field = ((SpanQuery) GetQuery()).GetField();
 			
 			Explanation idfExpl = new Explanation(idf, "idf(" + field + ": " + idfExp.Explain() + ")");
 			
 			// explain query weight
 			Explanation queryExpl = new Explanation();
-			queryExpl.SetDescription("queryWeight(" + GetQuery() + "), product of:");
+			queryExpl.Description = "queryWeight(" + GetQuery() + "), product of:";
 			
 			Explanation boostExpl = new Explanation(GetQuery().GetBoost(), "boost");
 			if (GetQuery().GetBoost() != 1.0f)
@@ -96,36 +99,36 @@ namespace Lucene.Net.Search.Spans
 			Explanation queryNormExpl = new Explanation(queryNorm, "queryNorm");
 			queryExpl.AddDetail(queryNormExpl);
 			
-			queryExpl.SetValue(boostExpl.GetValue() * idfExpl.GetValue() * queryNormExpl.GetValue());
+			queryExpl.Value = boostExpl.Value * idfExpl.Value * queryNormExpl.Value;
 			
 			result.AddDetail(queryExpl);
 			
 			// explain field weight
 			ComplexExplanation fieldExpl = new ComplexExplanation();
-			fieldExpl.SetDescription("fieldWeight(" + field + ":" + query.ToString(field) + " in " + doc + "), product of:");
+			fieldExpl.Description = "fieldWeight(" + field + ":" + query.ToString(field) + " in " + doc + "), product of:";
 			
-			Explanation tfExpl = Scorer(reader, true, false).Explain(doc);
+			Explanation tfExpl = ((SpanScorer)Scorer(reader, true, false)).Explain(doc);
 			fieldExpl.AddDetail(tfExpl);
 			fieldExpl.AddDetail(idfExpl);
 			
 			Explanation fieldNormExpl = new Explanation();
 			byte[] fieldNorms = reader.Norms(field);
 			float fieldNorm = fieldNorms != null?Similarity.DecodeNorm(fieldNorms[doc]):1.0f;
-			fieldNormExpl.SetValue(fieldNorm);
-			fieldNormExpl.SetDescription("fieldNorm(field=" + field + ", doc=" + doc + ")");
+			fieldNormExpl.Value = fieldNorm;
+			fieldNormExpl.Description = "fieldNorm(field=" + field + ", doc=" + doc + ")";
 			fieldExpl.AddDetail(fieldNormExpl);
 			
-			fieldExpl.SetMatch(tfExpl.IsMatch());
-			fieldExpl.SetValue(tfExpl.GetValue() * idfExpl.GetValue() * fieldNormExpl.GetValue());
+			fieldExpl.Match = tfExpl.IsMatch();
+			fieldExpl.Value = tfExpl.Value * idfExpl.Value * fieldNormExpl.Value;
 			
 			result.AddDetail(fieldExpl);
-			System.Boolean? tempAux = fieldExpl.GetMatch();
-			result.SetMatch(tempAux);
+			System.Boolean? tempAux = fieldExpl.Match;
+			result.Match = tempAux;
 			
 			// combine them
-			result.SetValue(queryExpl.GetValue() * fieldExpl.GetValue());
+			result.Value = queryExpl.Value * fieldExpl.Value;
 			
-			if (queryExpl.GetValue() == 1.0f)
+			if (queryExpl.Value == 1.0f)
 				return fieldExpl;
 			
 			return result;

Modified: incubator/lucene.net/trunk/src/core/Search/TermQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TermQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TermQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TermQuery.cs Tue Feb 28 22:43:08 2012
@@ -106,13 +106,13 @@ namespace Lucene.Net.Search
 			{
 				
 				ComplexExplanation result = new ComplexExplanation();
-				result.SetDescription("weight(" + GetQuery() + " in " + doc + "), product of:");
+				result.Description = "weight(" + GetQuery() + " in " + doc + "), product of:";
 				
 				Explanation expl = new Explanation(idf, idfExp.Explain());
 				
 				// explain query weight
 				Explanation queryExpl = new Explanation();
-				queryExpl.SetDescription("queryWeight(" + GetQuery() + "), product of:");
+				queryExpl.Description = "queryWeight(" + GetQuery() + "), product of:";
 				
 				Explanation boostExpl = new Explanation(Enclosing_Instance.GetBoost(), "boost");
 				if (Enclosing_Instance.GetBoost() != 1.0f)
@@ -122,37 +122,60 @@ namespace Lucene.Net.Search
 				Explanation queryNormExpl = new Explanation(queryNorm, "queryNorm");
 				queryExpl.AddDetail(queryNormExpl);
 				
-				queryExpl.SetValue(boostExpl.GetValue() * expl.GetValue() * queryNormExpl.GetValue());
+				queryExpl.Value = boostExpl.Value * expl.Value * queryNormExpl.Value;
 				
 				result.AddDetail(queryExpl);
 				
 				// explain field weight
 				System.String field = Enclosing_Instance.term.Field();
 				ComplexExplanation fieldExpl = new ComplexExplanation();
-				fieldExpl.SetDescription("fieldWeight(" + Enclosing_Instance.term + " in " + doc + "), product of:");
-				
-				Explanation tfExpl = Scorer(reader, true, false).Explain(doc);
-				fieldExpl.AddDetail(tfExpl);
+				fieldExpl.Description = "fieldWeight(" + Enclosing_Instance.term + " in " + doc + "), product of:";
+
+                Explanation tfExplanation = new Explanation();
+                int tf = 0;
+                TermDocs termDocs = reader.TermDocs(enclosingInstance.term);
+                if (termDocs != null)
+                {
+                    try
+                    {
+                        if (termDocs.SkipTo(doc) && termDocs.Doc() == doc)
+                        {
+                            tf = termDocs.Freq();
+                        }
+                    }
+                    finally
+                    {
+                        termDocs.Close();
+                    }
+                    tfExplanation.Value = similarity.Tf(tf);
+                    tfExplanation.Description = "tf(termFreq(" + enclosingInstance.term + ")=" + tf + ")";
+                }
+                else
+                {
+                    tfExplanation.Value = 0.0f;
+                    tfExplanation.Description = "no matching term";
+                }
+                fieldExpl.AddDetail(tfExplanation);
 				fieldExpl.AddDetail(expl);
 				
 				Explanation fieldNormExpl = new Explanation();
 				byte[] fieldNorms = reader.Norms(field);
 				float fieldNorm = fieldNorms != null?Similarity.DecodeNorm(fieldNorms[doc]):1.0f;
-				fieldNormExpl.SetValue(fieldNorm);
-				fieldNormExpl.SetDescription("fieldNorm(field=" + field + ", doc=" + doc + ")");
+				fieldNormExpl.Value = fieldNorm;
+				fieldNormExpl.Description = "fieldNorm(field=" + field + ", doc=" + doc + ")";
 				fieldExpl.AddDetail(fieldNormExpl);
-				
-				fieldExpl.SetMatch(tfExpl.IsMatch());
-				fieldExpl.SetValue(tfExpl.GetValue() * expl.GetValue() * fieldNormExpl.GetValue());
+
+                fieldExpl.Match = tfExplanation.IsMatch();
+                fieldExpl.Value = tfExplanation.Value * expl.Value * fieldNormExpl.Value;
 				
 				result.AddDetail(fieldExpl);
-				System.Boolean? tempAux = fieldExpl.GetMatch();
-				result.SetMatch(tempAux);
+				System.Boolean? tempAux = fieldExpl.Match;
+				result.Match = tempAux;
 				
 				// combine them
-				result.SetValue(queryExpl.GetValue() * fieldExpl.GetValue());
+				result.Value = queryExpl.Value * fieldExpl.Value;
 				
-				if (queryExpl.GetValue() == 1.0f)
+				if (queryExpl.Value == 1.0f)
 					return fieldExpl;
 				
 				return result;
@@ -176,9 +199,9 @@ namespace Lucene.Net.Search
 			return new TermWeight(this, searcher);
 		}
 		
-		public override void  ExtractTerms(System.Collections.Hashtable terms)
+		public override void  ExtractTerms(System.Collections.Generic.ISet<Term> terms)
 		{
-			SupportClass.CollectionsHelper.AddIfNotContains(terms, GetTerm());
+		    terms.Add(GetTerm());
 		}
 		
 		/// <summary>Prints a user-readable version of this query. </summary>

Modified: incubator/lucene.net/trunk/src/core/Search/TermRangeFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TermRangeFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TermRangeFilter.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TermRangeFilter.cs Tue Feb 28 22:43:08 2012
@@ -25,7 +25,7 @@ namespace Lucene.Net.Search
 	/// 
 	/// <p/>This filter matches the documents looking for terms that fall into the
 	/// supplied range according to <see cref="String.CompareTo(String)" />. It is not intended
-	/// for numerical ranges, use <see cref="NumericRangeFilter" /> instead.
+	/// for numerical ranges, use <see cref="NumericRangeFilter{T}" /> instead.
 	/// 
 	/// <p/>If you construct a large number of range filters with different ranges but on the 
 	/// same field, <see cref="FieldCacheRangeFilter" /> may have significantly better performance. 
@@ -33,7 +33,7 @@ namespace Lucene.Net.Search
 	/// <since> 2.9
 	/// </since>
 	[Serializable]
-	public class TermRangeFilter:MultiTermQueryWrapperFilter
+	public class TermRangeFilter:MultiTermQueryWrapperFilter<TermRangeQuery>
 	{
 		
 		/// <param name="fieldName">The field this range applies to
@@ -100,37 +100,37 @@ namespace Lucene.Net.Search
 		/// <summary>Returns the field name for this filter </summary>
 		public virtual System.String GetField()
 		{
-			return ((TermRangeQuery) query).GetField();
+		    return query.GetField();
 		}
 		
 		/// <summary>Returns the lower value of this range filter </summary>
 		public virtual System.String GetLowerTerm()
 		{
-			return ((TermRangeQuery) query).GetLowerTerm();
+		    return query.GetLowerTerm();
 		}
 		
 		/// <summary>Returns the upper value of this range filter </summary>
 		public virtual System.String GetUpperTerm()
 		{
-			return ((TermRangeQuery) query).GetUpperTerm();
+		    return query.GetUpperTerm();
 		}
 		
 		/// <summary>Returns <c>true</c> if the lower endpoint is inclusive </summary>
 		public virtual bool IncludesLower()
 		{
-			return ((TermRangeQuery) query).IncludesLower();
+		    return query.IncludesLower();
 		}
 		
 		/// <summary>Returns <c>true</c> if the upper endpoint is inclusive </summary>
 		public virtual bool IncludesUpper()
 		{
-			return ((TermRangeQuery) query).IncludesUpper();
+		    return query.IncludesUpper();
 		}
 		
 		/// <summary>Returns the collator used to determine range inclusion, if any. </summary>
 		public virtual System.Globalization.CompareInfo GetCollator()
 		{
-			return ((TermRangeQuery) query).GetCollator();
+		    return query.GetCollator();
 		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/src/core/Search/TermRangeQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TermRangeQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TermRangeQuery.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TermRangeQuery.cs Tue Feb 28 22:43:08 2012
@@ -27,7 +27,7 @@ namespace Lucene.Net.Search
 	/// 
 	/// <p/>This query matches the documents looking for terms that fall into the
 	/// supplied range according to <see cref="String.CompareTo(String)" />. It is not intended
-	/// for numerical ranges, use <see cref="NumericRangeQuery" /> instead.
+	/// for numerical ranges, use <see cref="NumericRangeQuery{T}" /> instead.
 	/// 
 	/// <p/>This query uses the <see cref="MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT" />
 	///

Modified: incubator/lucene.net/trunk/src/core/Search/TermScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TermScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TermScorer.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TermScorer.cs Tue Feb 28 22:43:08 2012
@@ -65,27 +65,11 @@ namespace Lucene.Net.Search
 				scoreCache[i] = GetSimilarity().Tf(i) * weightValue;
 		}
 		
-		/// <deprecated> use <see cref="Score(Collector)" /> instead. 
-		/// </deprecated>
-        [Obsolete("use Score(Collector) instead. ")]
-		public override void  Score(HitCollector hc)
-		{
-			Score(new HitCollectorWrapper(hc));
-		}
-		
 		public override void  Score(Collector c)
 		{
 			Score(c, System.Int32.MaxValue, NextDoc());
 		}
 		
-		/// <deprecated> use <see cref="Score(Collector, int, int)" /> instead. 
-		/// </deprecated>
-        [Obsolete("use Score(Collector, int, int) instead.")]
-		protected internal override bool Score(HitCollector c, int end)
-		{
-			return Score(new HitCollectorWrapper(c), end, doc);
-		}
-		
 		// firstDocID is ignored since nextDoc() sets 'doc'
 		public /*protected internal*/ override bool Score(Collector c, int end, int firstDocID)
 		{
@@ -114,14 +98,6 @@ namespace Lucene.Net.Search
 			return true;
 		}
 		
-		/// <deprecated> use <see cref="DocID()" /> instead. 
-		/// </deprecated>
-        [Obsolete("use DocID() instead. ")]
-		public override int Doc()
-		{
-			return doc;
-		}
-		
 		public override int DocID()
 		{
 			return doc;
@@ -132,21 +108,6 @@ namespace Lucene.Net.Search
 		/// <see cref="TermDocs.Read(int[],int[])" />.
 		/// 
 		/// </summary>
-		/// <returns> true iff there is another document matching the query.
-		/// </returns>
-		/// <deprecated> use <see cref="NextDoc()" /> instead.
-		/// </deprecated>
-        [Obsolete("use NextDoc() instead.")]
-		public override bool Next()
-		{
-			return NextDoc() != NO_MORE_DOCS;
-		}
-		
-		/// <summary> Advances to the next document matching the query. <br/>
-		/// The iterator over the matching documents is buffered using
-		/// <see cref="TermDocs.Read(int[],int[])" />.
-		/// 
-		/// </summary>
 		/// <returns> the document matching the query or -1 if there are no more documents.
 		/// </returns>
 		public override int NextDoc()
@@ -178,23 +139,6 @@ namespace Lucene.Net.Search
 			return norms == null?raw:raw * SIM_NORM_DECODER[norms[doc] & 0xFF]; // normalize for field
 		}
 		
-		/// <summary> Skips to the first match beyond the current whose document number is
-		/// greater than or equal to a given target. <br/>
-		/// The implementation uses <see cref="TermDocs.SkipTo(int)" />.
-		/// 
-		/// </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/>
 		/// The implementation uses <see cref="TermDocs.SkipTo(int)" />.
@@ -231,40 +175,6 @@ namespace Lucene.Net.Search
 			return doc;
 		}
 		
-		/// <summary>Returns an explanation of the score for a document.
-		/// <br/>When this method is used, the <see cref="Next()" /> method
-		/// and the <see cref="Score(HitCollector)" /> method should not be used.
-		/// </summary>
-		/// <param name="doc">The document number for the explanation.
-		/// </param>
-		public override Explanation Explain(int doc)
-		{
-			TermQuery query = (TermQuery) weight.GetQuery();
-			Explanation tfExplanation = new Explanation();
-			int tf = 0;
-			while (pointer < pointerMax)
-			{
-				if (docs[pointer] == doc)
-					tf = freqs[pointer];
-				pointer++;
-			}
-			if (tf == 0)
-			{
-				if (termDocs.SkipTo(doc))
-				{
-					if (termDocs.Doc() == doc)
-					{
-						tf = termDocs.Freq();
-					}
-				}
-			}
-			termDocs.Close();
-			tfExplanation.SetValue(GetSimilarity().Tf(tf));
-			tfExplanation.SetDescription("tf(termFreq(" + query.GetTerm() + ")=" + tf + ")");
-			
-			return tfExplanation;
-		}
-		
 		/// <summary>Returns a string representation of this <c>TermScorer</c>. </summary>
 		public override System.String ToString()
 		{

Modified: incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TimeLimitingCollector.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using Lucene.Net.Support;
 using IndexReader = Lucene.Net.Index.IndexReader;
 
 namespace Lucene.Net.Search
@@ -48,7 +48,7 @@ namespace Lucene.Net.Search
 		
 		private bool greedy;
 		
-		private sealed class TimerThread:SupportClass.ThreadClass
+		private sealed class TimerThread:ThreadClass
 		{
 			
 			// NOTE: we can avoid explicit synchronization here for several reasons:
@@ -85,8 +85,7 @@ namespace Lucene.Net.Search
 					}
 					catch (System.Threading.ThreadInterruptedException ie)
 					{
-						SupportClass.ThreadClass.Current().Interrupt();
-						throw new System.SystemException(ie.Message, ie);
+					    throw;
 					}
 				}
 			}

Modified: incubator/lucene.net/trunk/src/core/Search/TopDocs.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TopDocs.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TopDocs.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TopDocs.cs Tue Feb 28 22:43:08 2012
@@ -26,34 +26,31 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public class TopDocs
 	{
-		/// <summary>The total number of hits for the query.</summary>
-		/// <seealso cref="Hits.Length()">
-		/// </seealso>
-        [Obsolete("For backward compatibility. Use TotalHits instead")]
-		public int totalHits;
-		/// <summary>The top hits for the query. </summary>
-        [Obsolete("For backward compatibility. Use ScoreDocs instead")]
-		public ScoreDoc[] scoreDocs;
-		/// <summary>Stores the maximum score value encountered, needed for normalizing. </summary>
-        [Obsolete("For backward compatibility. Use MaxScore instead")]
-		private float maxScore;
+		private int _totalHits;
+        private ScoreDoc[] _scoreDocs;
+        private float _maxScore;
 
+        /// <summary>The total number of hits for the query.</summary>
+        /// <seealso cref="Hits.Length()">
+        /// </seealso>
         public int TotalHits
         {
-            get { return totalHits; }
-            set { totalHits = value; }
+            get { return _totalHits; }
+            set { _totalHits = value; }
         }
 
+        /// <summary>The top hits for the query. </summary>
         public ScoreDoc[] ScoreDocs
         {
-            get { return scoreDocs; }
-            set { scoreDocs = value; }
+            get { return _scoreDocs; }
+            set { _scoreDocs = value; }
         }
 
+        /// <summary>Stores the maximum score value encountered, needed for normalizing. </summary>
         public float MaxScore
         {
-            get { return maxScore; }
-            set { maxScore = value; }
+            get { return _maxScore; }
+            set { _maxScore = value; }
         }
 
 

Modified: incubator/lucene.net/trunk/src/core/Search/TopDocsCollector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Search/TopDocsCollector.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Search/TopDocsCollector.cs (original)
+++ incubator/lucene.net/trunk/src/core/Search/TopDocsCollector.cs Tue Feb 28 22:43:08 2012
@@ -16,20 +16,18 @@
  */
 
 using System;
-
-using PriorityQueue = Lucene.Net.Util.PriorityQueue;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Search
 {
-	
 	/// <summary> A base class for all collectors that return a <see cref="Lucene.Net.Search.TopDocs" /> output. This
 	/// collector allows easy extension by providing a single constructor which
-	/// accepts a <see cref="PriorityQueue" /> as well as protected members for that
+	/// accepts a <see cref="PriorityQueue{T}" /> as well as protected members for that
 	/// priority queue and a counter of the number of total hits.<br/>
 	/// Extending classes can override <see cref="TopDocs(int, int)" /> and
 	/// <see cref="GetTotalHits()" /> in order to provide their own implementation.
 	/// </summary>
-	public abstract class TopDocsCollector:Collector
+	public abstract class TopDocsCollector<T> : Collector where T : ScoreDoc
 	{
 		
 		// This is used in case topDocs() is called with illegal parameters, or there
@@ -41,12 +39,12 @@ namespace Lucene.Net.Search
 		/// HitQueue for example aggregates the top scoring documents, while other PQ
 		/// implementations may hold documents sorted by other criteria.
 		/// </summary>
-		protected internal PriorityQueue pq;
+		protected internal PriorityQueue<T> pq;
 		
 		/// <summary>The total number of documents that the collector encountered. </summary>
 		protected internal int totalHits;
 		
-		protected internal TopDocsCollector(PriorityQueue pq)
+		protected internal TopDocsCollector(PriorityQueue<T> pq)
 		{
 			this.pq = pq;
 		}
@@ -58,7 +56,7 @@ namespace Lucene.Net.Search
 		{
 			for (int i = howMany - 1; i >= 0; i--)
 			{
-				results[i] = (ScoreDoc) pq.Pop();
+				results[i] = pq.Pop();
 			}
 		}
 



Mime
View raw message