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: r1100652 - /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs
Date Sat, 07 May 2011 23:09:55 GMT
Author: digy
Date: Sat May  7 23:09:55 2011
New Revision: 1100652

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

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs?rev=1100652&r1=1100651&r2=1100652&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/MappingCharFilter.cs
Sat May  7 23:09:55 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis
 {
@@ -30,7 +31,7 @@ namespace Lucene.Net.Analysis
 		
 		private NormalizeCharMap normMap;
 		//private LinkedList<Character> buffer;
-		private System.Collections.ArrayList buffer;
+        private LinkedList<char> buffer; //JAVA: private LinkedList<Character>
buffer;
 		private System.String replacement;
 		private int charPointer;
 		private int nextCharCounter;
@@ -88,10 +89,10 @@ namespace Lucene.Net.Analysis
 			nextCharCounter++;
 			if (buffer != null && !(buffer.Count == 0))
 			{
-				System.Object tempObject;
-				tempObject = buffer[0];
-				buffer.RemoveAt(0);
-				return ((System.Char) tempObject);
+				char tempObject;
+				tempObject = buffer.First.Value;
+                buffer.RemoveFirst();
+				return (tempObject);
 			}
 			return input.Read();
 		}
@@ -101,18 +102,18 @@ namespace Lucene.Net.Analysis
 			nextCharCounter--;
 			if (buffer == null)
 			{
-				buffer = new System.Collections.ArrayList();
+                buffer = new LinkedList<char>();
 			}
-			buffer.Insert(0, (char) c);
+			buffer.AddFirst((char)c);
 		}
 		
 		private void  PushLastChar(int c)
 		{
 			if (buffer == null)
 			{
-				buffer = new System.Collections.ArrayList();
+                buffer = new LinkedList<char>();
 			}
-			buffer.Insert(buffer.Count, (char) c);
+			buffer.AddLast((char)c);
 		}
 		
 		private NormalizeCharMap Match(NormalizeCharMap map)



Mime
View raw message