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: r1102686 - /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs
Date Fri, 13 May 2011 12:00:20 GMT
Author: digy
Date: Fri May 13 12:00:20 2011
New Revision: 1102686

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

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs?rev=1102686&r1=1102685&r2=1102686&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Util/Parameter.cs Fri May 13
12:00:20 2011
@@ -26,7 +26,7 @@ namespace Lucene.Net.Util
     public abstract class Parameter 
 	{
         internal static Dictionary<string, Parameter> allParameters = new Dictionary<string,
Parameter>();
-		
+                
 		private System.String name;
 		
 		private Parameter()
@@ -39,9 +39,10 @@ namespace Lucene.Net.Util
 			// typesafe enum pattern, no public constructor
 			this.name = name;
 			string key = MakeKey(name);
-			
-			if (allParameters.ContainsKey(key))
-				throw new System.ArgumentException("Parameter name " + key + " already used!");
+
+            if (allParameters.ContainsKey(key))
+                return;
+			//	throw new System.ArgumentException("Parameter name " + key + " already used!");
 			
 			allParameters[key] = this;
 		}
@@ -73,6 +74,17 @@ namespace Lucene.Net.Util
         //    return par;
         //}
 
+
+        public static bool operator==(Parameter p1,Parameter p2)
+        {
+            return p1.Equals(p2);
+        }
+
+        public static bool operator !=(Parameter p1, Parameter p2)
+        {
+            return !p1.Equals(p2);
+        }
+
         public override bool Equals(object obj)
         {
             if (obj.GetType() != this.GetType()) return false;



Mime
View raw message