lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1097357 - in /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index: CheckIndex.cs IndexWriter.cs SegmentInfo.cs SegmentInfos.cs SegmentReader.cs
Date Thu, 28 Apr 2011 08:31:42 GMT
Author: digy
Date: Thu Apr 28 08:31:42 2011
New Revision: 1097357

URL: http://svn.apache.org/viewvc?rev=1097357&view=rev
Log:
[LUCENENET-412] SegmentInfos

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/CheckIndex.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/IndexWriter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfo.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentReader.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/CheckIndex.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/CheckIndex.cs?rev=1097357&r1=1097356&r2=1097357&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/CheckIndex.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/CheckIndex.cs Thu Apr 28
08:31:42 2011
@@ -638,7 +638,7 @@ namespace Lucene.Net.Index
 				}
 				
 				// Keeper
-                result.newSegments.Add((SegmentInfo)info.Clone());
+                result.newSegments.Add(info.Clone());
 			}
 			
 			if (0 == result.numBadSegments)

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/IndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/IndexWriter.cs?rev=1097357&r1=1097356&r2=1097357&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/IndexWriter.cs Thu Apr
28 08:31:42 2011
@@ -541,7 +541,7 @@ namespace Lucene.Net.Index
 					int idx = Enclosing_Instance.segmentInfos.IndexOf(info);
 					if (idx != - 1)
 					{
-						info = (SegmentInfo) Enclosing_Instance.segmentInfos[idx];
+						info = Enclosing_Instance.segmentInfos[idx];
 					}
 					return info;
 				}
@@ -5363,7 +5363,7 @@ namespace Lucene.Net.Index
 				
 				merge.info.SetHasProx(merger.HasProx());
 				
-                segmentInfos.GetRange(start, start + merge.segments.Count - start).Clear();
+                segmentInfos.RemoveRange(start, start + merge.segments.Count - start);
 				System.Diagnostics.Debug.Assert(!segmentInfos.Contains(merge.info));
 				segmentInfos.Insert(start, merge.info);
 

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfo.cs?rev=1097357&r1=1097356&r2=1097357&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfo.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfo.cs Thu Apr
28 08:31:42 2011
@@ -32,7 +32,7 @@ namespace Lucene.Net.Index
 	/// * <p/><b>NOTE:</b> This API is new and still experimental
 	/// (subject to change suddenly in the next release)<p/>
 	/// </summary>
-	public sealed class SegmentInfo : System.ICloneable,IEquatable<SegmentInfo>
+	public sealed class SegmentInfo : IEquatable<SegmentInfo>
 	{
 		
 		internal const int NO = - 1; // e.g. no norms; no deletes;
@@ -360,7 +360,7 @@ namespace Lucene.Net.Index
 			ClearFiles();
 		}
 		
-		public System.Object Clone()
+		public SegmentInfo Clone()
 		{
 			SegmentInfo si = new SegmentInfo(name, docCount, dir);
 			si.isCompoundFile = isCompoundFile;

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs?rev=1097357&r1=1097356&r2=1097357&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentInfos.cs Thu Apr
28 08:31:42 2011
@@ -35,7 +35,7 @@ namespace Lucene.Net.Index
 	/// (subject to change suddenly in the next release)<p/>
 	/// </summary>
 	[Serializable]
-	public sealed class SegmentInfos:System.Collections.ArrayList
+	public sealed class SegmentInfos: List<SegmentInfo> 
 	{
 		private class AnonymousClassFindSegmentsFile:FindSegmentsFile
 		{
@@ -136,7 +136,7 @@ namespace Lucene.Net.Index
 		
 		public SegmentInfo Info(int i)
 		{
-			return (SegmentInfo) this[i];
+			return this[i];
 		}
 		
 		/// <summary> Get the generation (N) of the current segments_N file
@@ -433,12 +433,12 @@ namespace Lucene.Net.Index
 		/// SegmentInfo.
 		/// </summary>
 		
-		public override System.Object Clone()
+		public SegmentInfos Clone()
 		{
             SegmentInfos sis = new SegmentInfos();
             for (int i = 0; i < this.Count; i++)
             {
-                sis.Add(((SegmentInfo) this[i]).Clone());
+                sis.Add(this[i].Clone());
             }
             sis.counter = this.counter;
             sis.generation = this.generation;
@@ -851,7 +851,7 @@ namespace Lucene.Net.Index
 		public SegmentInfos Range(int first, int last)
 		{
 			SegmentInfos infos = new SegmentInfos();
-			infos.AddRange((System.Collections.IList) ((System.Collections.ArrayList) this).GetRange(first,
last - first));
+			infos.AddRange(this.GetRange(first, last - first));
 			return infos;
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentReader.cs?rev=1097357&r1=1097356&r2=1097357&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SegmentReader.cs Thu Apr
28 08:31:42 2011
@@ -1684,7 +1684,7 @@ namespace Lucene.Net.Index
 		
 		internal virtual void  StartCommit()
 		{
-            rollbackSegmentInfo = (SegmentInfo)si.Clone();
+            rollbackSegmentInfo = si.Clone();
 			rollbackHasChanges = hasChanges;
 			rollbackDeletedDocsDirty = deletedDocsDirty;
 			rollbackNormsDirty = normsDirty;



Mime
View raw message