lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [18/21] More work on Lucene.Net.Queries
Date Fri, 19 Sep 2014 14:19:51 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
index afc2a59..572f72d 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/DoubleDocValues.cs
@@ -1,256 +1,251 @@
 using System;
+using Lucene.Net.Index;
+using Lucene.Net.Util.Mutable;
 
-namespace org.apache.lucene.queries.function.docvalues
+namespace Lucene.Net.Queries.Function.DocValues
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using IndexReader = org.apache.lucene.index.IndexReader;
-	using MutableValue = org.apache.lucene.util.mutable.MutableValue;
-	using MutableValueDouble = org.apache.lucene.util.mutable.MutableValueDouble;
-
-	/// <summary>
-	/// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving double values.
-	/// Implementations can control how the double values are loaded through <seealso cref="#doubleVal(int)"/>}
-	/// </summary>
-	public abstract class DoubleDocValues : FunctionValues
-	{
-	  protected internal readonly ValueSource vs;
-
-	  public DoubleDocValues(ValueSource vs)
-	  {
-		this.vs = vs;
-	  }
-
-	  public override sbyte byteVal(int doc)
-	  {
-		return (sbyte)doubleVal(doc);
-	  }
-
-	  public override short shortVal(int doc)
-	  {
-		return (short)doubleVal(doc);
-	  }
-
-	  public override float floatVal(int doc)
-	  {
-		return (float)doubleVal(doc);
-	  }
-
-	  public override int intVal(int doc)
-	  {
-		return (int)doubleVal(doc);
-	  }
-
-	  public override long longVal(int doc)
-	  {
-		return (long)doubleVal(doc);
-	  }
-
-	  public override bool boolVal(int doc)
-	  {
-		return doubleVal(doc) != 0;
-	  }
-
-	  public override abstract double doubleVal(int doc);
-
-	  public override string strVal(int doc)
-	  {
-		return Convert.ToString(doubleVal(doc));
-	  }
-
-	  public override object objectVal(int doc)
-	  {
-		return exists(doc) ? doubleVal(doc) : null;
-	  }
-
-	  public override string ToString(int doc)
-	  {
-		return vs.description() + '=' + strVal(doc);
-	  }
-
-	  public override ValueSourceScorer getRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
-	  {
-		double lower, upper;
-
-		if (lowerVal == null)
-		{
-		  lower = double.NegativeInfinity;
-		}
-		else
-		{
-		  lower = Convert.ToDouble(lowerVal);
-		}
-
-		 if (upperVal == null)
-		 {
-		  upper = double.PositiveInfinity;
-		 }
-		else
-		{
-		  upper = Convert.ToDouble(upperVal);
-		}
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final double l = lower;
-		double l = lower;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final double u = upper;
-		double u = upper;
-
-
-		if (includeLower && includeUpper)
-		{
-		  return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, l, u);
-		}
-		else if (includeLower && !includeUpper)
-		{
-		  return new ValueSourceScorerAnonymousInnerClassHelper2(this, reader, this, l, u);
-		}
-		else if (!includeLower && includeUpper)
-		{
-		  return new ValueSourceScorerAnonymousInnerClassHelper3(this, reader, this, l, u);
-		}
-		else
-		{
-		  return new ValueSourceScorerAnonymousInnerClassHelper4(this, reader, this, l, u);
-		}
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
-	  {
-		  private readonly DoubleDocValues outerInstance;
-
-		  private double l;
-		  private double u;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper(DoubleDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.DoubleDocValues this, double l, double u) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.l = l;
-			  this.u = u;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			double docVal = outerInstance.doubleVal(doc);
-			return docVal >= l && docVal <= u;
-		  }
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper2 : ValueSourceScorer
-	  {
-		  private readonly DoubleDocValues outerInstance;
-
-		  private double l;
-		  private double u;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper2(DoubleDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.DoubleDocValues this, double l, double u) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.l = l;
-			  this.u = u;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			double docVal = outerInstance.doubleVal(doc);
-			return docVal >= l && docVal < u;
-		  }
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper3 : ValueSourceScorer
-	  {
-		  private readonly DoubleDocValues outerInstance;
-
-		  private double l;
-		  private double u;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper3(DoubleDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.DoubleDocValues this, double l, double u) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.l = l;
-			  this.u = u;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			double docVal = outerInstance.doubleVal(doc);
-			return docVal > l && docVal <= u;
-		  }
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper4 : ValueSourceScorer
-	  {
-		  private readonly DoubleDocValues outerInstance;
-
-		  private double l;
-		  private double u;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper4(DoubleDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.DoubleDocValues this, double l, double u) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.l = l;
-			  this.u = u;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			double docVal = outerInstance.doubleVal(doc);
-			return docVal > l && docVal < u;
-		  }
-	  }
-
-	  public override ValueFiller ValueFiller
-	  {
-		  get
-		  {
-			return new ValueFillerAnonymousInnerClassHelper(this);
-		  }
-	  }
-
-	  private class ValueFillerAnonymousInnerClassHelper : ValueFiller
-	  {
-		  private readonly DoubleDocValues outerInstance;
-
-		  public ValueFillerAnonymousInnerClassHelper(DoubleDocValues outerInstance)
-		  {
-			  this.outerInstance = outerInstance;
-			  mval = new MutableValueDouble();
-		  }
-
-		  private readonly MutableValueDouble mval;
-
-		  public override MutableValue Value
-		  {
-			  get
-			  {
-				return mval;
-			  }
-		  }
-
-		  public override void fillValue(int doc)
-		  {
-			mval.value = outerInstance.doubleVal(doc);
-			mval.exists = outerInstance.exists(doc);
-		  }
-	  }
-
-	}
-
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving double values.
+    /// Implementations can control how the double values are loaded through <seealso cref="#DoubleVal(int)"/>}
+    /// </summary>
+    public abstract class DoubleDocValues : FunctionValues
+    {
+        protected internal readonly ValueSource vs;
+
+        protected DoubleDocValues(ValueSource vs)
+        {
+            this.vs = vs;
+        }
+
+        public override sbyte ByteVal(int doc)
+        {
+            return (sbyte)DoubleVal(doc);
+        }
+
+        public override short ShortVal(int doc)
+        {
+            return (short)DoubleVal(doc);
+        }
+
+        public override float FloatVal(int doc)
+        {
+            return (float)DoubleVal(doc);
+        }
+
+        public override int IntVal(int doc)
+        {
+            return (int)DoubleVal(doc);
+        }
+
+        public override long LongVal(int doc)
+        {
+            return (long)DoubleVal(doc);
+        }
+
+        public override bool BoolVal(int doc)
+        {
+            return DoubleVal(doc) != 0;
+        }
+
+        public override abstract double DoubleVal(int doc);
+
+        public override string StrVal(int doc)
+        {
+            return Convert.ToString(DoubleVal(doc));
+        }
+
+        public override object ObjectVal(int doc)
+        {
+            return Exists(doc) ? DoubleVal(doc) : (double?)null;
+        }
+
+        public override string ToString(int doc)
+        {
+            return vs.Description + '=' + StrVal(doc);
+        }
+
+        public override ValueSourceScorer GetRangeScorer(IndexReader reader, string lowerVal, string upperVal,
+            bool includeLower, bool includeUpper)
+        {
+            double lower, upper;
+
+            if (lowerVal == null)
+            {
+                lower = double.NegativeInfinity;
+            }
+            else
+            {
+                lower = Convert.ToDouble(lowerVal);
+            }
+
+            if (upperVal == null)
+            {
+                upper = double.PositiveInfinity;
+            }
+            else
+            {
+                upper = Convert.ToDouble(upperVal);
+            }
+
+            double l = lower;
+            double u = upper;
+            if (includeLower && includeUpper)
+            {
+                return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, l, u);
+            }
+            else if (includeLower && !includeUpper)
+            {
+                return new ValueSourceScorerAnonymousInnerClassHelper2(this, reader, this, l, u);
+            }
+            else if (!includeLower && includeUpper)
+            {
+                return new ValueSourceScorerAnonymousInnerClassHelper3(this, reader, this, l, u);
+            }
+            else
+            {
+                return new ValueSourceScorerAnonymousInnerClassHelper4(this, reader, this, l, u);
+            }
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
+        {
+            private readonly DoubleDocValues outerInstance;
+
+            private double l;
+            private double u;
+
+            public ValueSourceScorerAnonymousInnerClassHelper(DoubleDocValues outerInstance, IndexReader reader, DoubleDocValues @this, double l, double u)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.l = l;
+                this.u = u;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                double docVal = outerInstance.DoubleVal(doc);
+                return docVal >= l && docVal <= u;
+            }
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper2 : ValueSourceScorer
+        {
+            private readonly DoubleDocValues outerInstance;
+
+            private double l;
+            private double u;
+
+            public ValueSourceScorerAnonymousInnerClassHelper2(DoubleDocValues outerInstance, IndexReader reader, DoubleDocValues @this, double l, double u)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.l = l;
+                this.u = u;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                double docVal = outerInstance.DoubleVal(doc);
+                return docVal >= l && docVal < u;
+            }
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper3 : ValueSourceScorer
+        {
+            private readonly DoubleDocValues outerInstance;
+
+            private double l;
+            private double u;
+
+            public ValueSourceScorerAnonymousInnerClassHelper3(DoubleDocValues outerInstance, IndexReader reader, DoubleDocValues @this, double l, double u)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.l = l;
+                this.u = u;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                double docVal = outerInstance.DoubleVal(doc);
+                return docVal > l && docVal <= u;
+            }
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper4 : ValueSourceScorer
+        {
+            private readonly DoubleDocValues outerInstance;
+
+            private double l;
+            private double u;
+
+            public ValueSourceScorerAnonymousInnerClassHelper4(DoubleDocValues outerInstance, IndexReader reader,
+                DoubleDocValues @this, double l, double u)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.l = l;
+                this.u = u;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                double docVal = outerInstance.DoubleVal(doc);
+                return docVal > l && docVal < u;
+            }
+        }
+
+        public override AbstractValueFiller ValueFiller
+        {
+            get
+            {
+                return new ValueFillerAnonymousInnerClassHelper(this);
+            }
+        }
+
+        private class ValueFillerAnonymousInnerClassHelper : AbstractValueFiller
+        {
+            private readonly DoubleDocValues outerInstance;
+
+            public ValueFillerAnonymousInnerClassHelper(DoubleDocValues outerInstance)
+            {
+                this.outerInstance = outerInstance;
+                mval = new MutableValueDouble();
+            }
+
+            private readonly MutableValueDouble mval;
+
+            public override MutableValue Value
+            {
+                get
+                {
+                    return mval;
+                }
+            }
+
+            public override void FillValue(int doc)
+            {
+                mval.Value = outerInstance.DoubleVal(doc);
+                mval.Exists = outerInstance.Exists(doc);
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
index 72df9b0..130ed04 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/FloatDocValues.cs
@@ -1,117 +1,113 @@
 using System;
+using Lucene.Net.Util.Mutable;
 
-namespace org.apache.lucene.queries.function.docvalues
+namespace Lucene.Net.Queries.Function.DocValues
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using MutableValue = org.apache.lucene.util.mutable.MutableValue;
-	using MutableValueFloat = org.apache.lucene.util.mutable.MutableValueFloat;
-
-	/// <summary>
-	/// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving float values.
-	/// Implementations can control how the float values are loaded through <seealso cref="#floatVal(int)"/>}
-	/// </summary>
-	public abstract class FloatDocValues : FunctionValues
-	{
-	  protected internal readonly ValueSource vs;
-
-	  public FloatDocValues(ValueSource vs)
-	  {
-		this.vs = vs;
-	  }
-
-	  public override sbyte byteVal(int doc)
-	  {
-		return (sbyte)floatVal(doc);
-	  }
-
-	  public override short shortVal(int doc)
-	  {
-		return (short)floatVal(doc);
-	  }
-
-	  public override abstract float floatVal(int doc);
-
-	  public override int intVal(int doc)
-	  {
-		return (int)floatVal(doc);
-	  }
-
-	  public override long longVal(int doc)
-	  {
-		return (long)floatVal(doc);
-	  }
-
-	  public override double doubleVal(int doc)
-	  {
-		return (double)floatVal(doc);
-	  }
-
-	  public override string strVal(int doc)
-	  {
-		return Convert.ToString(floatVal(doc));
-	  }
-
-	  public override object objectVal(int doc)
-	  {
-		return exists(doc) ? floatVal(doc) : null;
-	  }
-
-	  public override string ToString(int doc)
-	  {
-		return vs.description() + '=' + strVal(doc);
-	  }
-
-	  public override ValueFiller ValueFiller
-	  {
-		  get
-		  {
-			return new ValueFillerAnonymousInnerClassHelper(this);
-		  }
-	  }
-
-	  private class ValueFillerAnonymousInnerClassHelper : ValueFiller
-	  {
-		  private readonly FloatDocValues outerInstance;
-
-		  public ValueFillerAnonymousInnerClassHelper(FloatDocValues outerInstance)
-		  {
-			  this.outerInstance = outerInstance;
-			  mval = new MutableValueFloat();
-		  }
-
-		  private readonly MutableValueFloat mval;
-
-		  public override MutableValue Value
-		  {
-			  get
-			  {
-				return mval;
-			  }
-		  }
-
-		  public override void fillValue(int doc)
-		  {
-			mval.value = outerInstance.floatVal(doc);
-			mval.exists = outerInstance.exists(doc);
-		  }
-	  }
-	}
-
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving float values.
+    /// Implementations can control how the float values are loaded through <seealso cref="#FloatVal(int)"/>}
+    /// </summary>
+    public abstract class FloatDocValues : FunctionValues
+    {
+        protected internal readonly ValueSource vs;
+
+        public FloatDocValues(ValueSource vs)
+        {
+            this.vs = vs;
+        }
+
+        public override sbyte ByteVal(int doc)
+        {
+            return (sbyte)FloatVal(doc);
+        }
+
+        public override short ShortVal(int doc)
+        {
+            return (short)FloatVal(doc);
+        }
+
+        public override abstract float FloatVal(int doc);
+
+        public override int IntVal(int doc)
+        {
+            return (int)FloatVal(doc);
+        }
+
+        public override long LongVal(int doc)
+        {
+            return (long)FloatVal(doc);
+        }
+
+        public override double DoubleVal(int doc)
+        {
+            return (double)FloatVal(doc);
+        }
+
+        public override string StrVal(int doc)
+        {
+            return Convert.ToString(FloatVal(doc));
+        }
+
+        public override object ObjectVal(int doc)
+        {
+            return Exists(doc) ? FloatVal(doc) : (float?)null;
+        }
+
+        public override string ToString(int doc)
+        {
+            return vs.Description + '=' + StrVal(doc);
+        }
+
+        public override AbstractValueFiller ValueFiller
+        {
+            get
+            {
+                return new ValueFillerAnonymousInnerClassHelper(this);
+            }
+        }
+
+        private class ValueFillerAnonymousInnerClassHelper : AbstractValueFiller
+        {
+            private readonly FloatDocValues outerInstance;
+
+            public ValueFillerAnonymousInnerClassHelper(FloatDocValues outerInstance)
+            {
+                this.outerInstance = outerInstance;
+                mval = new MutableValueFloat();
+            }
+
+            private readonly MutableValueFloat mval;
+
+            public override MutableValue Value
+            {
+                get
+                {
+                    return mval;
+                }
+            }
+
+            public override void FillValue(int doc)
+            {
+                mval.Value = outerInstance.FloatVal(doc);
+                mval.Exists = outerInstance.Exists(doc);
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
index c3f934e..a4fd701 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/IntDocValues.cs
@@ -1,183 +1,177 @@
 using System;
+using Lucene.Net.Index;
+using Lucene.Net.Util.Mutable;
 
-namespace org.apache.lucene.queries.function.docvalues
+namespace Lucene.Net.Queries.Function.DocValues
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using IndexReader = org.apache.lucene.index.IndexReader;
-	using MutableValue = org.apache.lucene.util.mutable.MutableValue;
-	using MutableValueInt = org.apache.lucene.util.mutable.MutableValueInt;
-
-	/// <summary>
-	/// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving int values.
-	/// Implementations can control how the int values are loaded through <seealso cref="#intVal(int)"/>
-	/// </summary>
-	public abstract class IntDocValues : FunctionValues
-	{
-	  protected internal readonly ValueSource vs;
-
-	  public IntDocValues(ValueSource vs)
-	  {
-		this.vs = vs;
-	  }
-
-	  public override sbyte byteVal(int doc)
-	  {
-		return (sbyte)intVal(doc);
-	  }
-
-	  public override short shortVal(int doc)
-	  {
-		return (short)intVal(doc);
-	  }
-
-	  public override float floatVal(int doc)
-	  {
-		return (float)intVal(doc);
-	  }
-
-	  public override abstract int intVal(int doc);
-
-	  public override long longVal(int doc)
-	  {
-		return (long)intVal(doc);
-	  }
-
-	  public override double doubleVal(int doc)
-	  {
-		return (double)intVal(doc);
-	  }
-
-	  public override string strVal(int doc)
-	  {
-		return Convert.ToString(intVal(doc));
-	  }
-
-	  public override object objectVal(int doc)
-	  {
-		return exists(doc) ? intVal(doc) : null;
-	  }
-
-	  public override string ToString(int doc)
-	  {
-		return vs.description() + '=' + strVal(doc);
-	  }
-
-	  public override ValueSourceScorer getRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
-	  {
-		int lower, upper;
-
-		// instead of using separate comparison functions, adjust the endpoints.
-
-		if (lowerVal == null)
-		{
-		  lower = int.MinValue;
-		}
-		else
-		{
-		  lower = Convert.ToInt32(lowerVal);
-		  if (!includeLower && lower < int.MaxValue)
-		  {
-			  lower++;
-		  }
-		}
-
-		 if (upperVal == null)
-		 {
-		  upper = int.MaxValue;
-		 }
-		else
-		{
-		  upper = Convert.ToInt32(upperVal);
-		  if (!includeUpper && upper > int.MinValue)
-		  {
-			  upper--;
-		  }
-		}
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int ll = lower;
-		int ll = lower;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int uu = upper;
-		int uu = upper;
-
-		return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, ll, uu);
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
-	  {
-		  private readonly IntDocValues outerInstance;
-
-		  private int ll;
-		  private int uu;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper(IntDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.IntDocValues this, int ll, int uu) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.ll = ll;
-			  this.uu = uu;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			int val = outerInstance.intVal(doc);
-			// only check for deleted if it's the default value
-			// if (val==0 && reader.isDeleted(doc)) return false;
-			return val >= ll && val <= uu;
-		  }
-	  }
-
-	  public override ValueFiller ValueFiller
-	  {
-		  get
-		  {
-			return new ValueFillerAnonymousInnerClassHelper(this);
-		  }
-	  }
-
-	  private class ValueFillerAnonymousInnerClassHelper : ValueFiller
-	  {
-		  private readonly IntDocValues outerInstance;
-
-		  public ValueFillerAnonymousInnerClassHelper(IntDocValues outerInstance)
-		  {
-			  this.outerInstance = outerInstance;
-			  mval = new MutableValueInt();
-		  }
-
-		  private readonly MutableValueInt mval;
-
-		  public override MutableValue Value
-		  {
-			  get
-			  {
-				return mval;
-			  }
-		  }
-
-		  public override void fillValue(int doc)
-		  {
-			mval.value = outerInstance.intVal(doc);
-			mval.exists = outerInstance.exists(doc);
-		  }
-	  }
-	}
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving int values.
+    /// Implementations can control how the int values are loaded through <seealso cref="#IntVal(int)"/>
+    /// </summary>
+    public abstract class IntDocValues : FunctionValues
+    {
+        protected internal readonly ValueSource vs;
+
+        public IntDocValues(ValueSource vs)
+        {
+            this.vs = vs;
+        }
+
+        public override sbyte ByteVal(int doc)
+        {
+            return (sbyte)IntVal(doc);
+        }
+
+        public override short ShortVal(int doc)
+        {
+            return (short)IntVal(doc);
+        }
+
+        public override float FloatVal(int doc)
+        {
+            return (float)IntVal(doc);
+        }
+
+        public override abstract int IntVal(int doc);
+
+        public override long LongVal(int doc)
+        {
+            return (long)IntVal(doc);
+        }
+
+        public override double DoubleVal(int doc)
+        {
+            return (double)IntVal(doc);
+        }
+
+        public override string StrVal(int doc)
+        {
+            return Convert.ToString(IntVal(doc));
+        }
+
+        public override object ObjectVal(int doc)
+        {
+            return Exists(doc) ? IntVal(doc) : (int?)null;
+        }
+
+        public override string ToString(int doc)
+        {
+            return vs.Description + '=' + StrVal(doc);
+        }
+
+        public override ValueSourceScorer GetRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
+        {
+            int lower, upper;
+
+            // instead of using separate comparison functions, adjust the endpoints.
+
+            if (lowerVal == null)
+            {
+                lower = int.MinValue;
+            }
+            else
+            {
+                lower = Convert.ToInt32(lowerVal);
+                if (!includeLower && lower < int.MaxValue)
+                {
+                    lower++;
+                }
+            }
+
+            if (upperVal == null)
+            {
+                upper = int.MaxValue;
+            }
+            else
+            {
+                upper = Convert.ToInt32(upperVal);
+                if (!includeUpper && upper > int.MinValue)
+                {
+                    upper--;
+                }
+            }
+
+            int ll = lower;
+            int uu = upper;
+
+            return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, ll, uu);
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
+        {
+            private readonly IntDocValues outerInstance;
+
+            private int ll;
+            private int uu;
+
+            public ValueSourceScorerAnonymousInnerClassHelper(IntDocValues outerInstance, IndexReader reader, IntDocValues @this, int ll, int uu)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.ll = ll;
+                this.uu = uu;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                int val = outerInstance.IntVal(doc);
+                // only check for deleted if it's the default value
+                // if (val==0 && reader.isDeleted(doc)) return false;
+                return val >= ll && val <= uu;
+            }
+        }
+
+        public override AbstractValueFiller ValueFiller
+        {
+            get
+            {
+                return new ValueFillerAnonymousInnerClassHelper(this);
+            }
+        }
+
+        private class ValueFillerAnonymousInnerClassHelper : AbstractValueFiller
+        {
+            private readonly IntDocValues outerInstance;
+
+            public ValueFillerAnonymousInnerClassHelper(IntDocValues outerInstance)
+            {
+                this.outerInstance = outerInstance;
+                mval = new MutableValueInt();
+            }
+
+            private readonly MutableValueInt mval;
+
+            public override MutableValue Value
+            {
+                get
+                {
+                    return mval;
+                }
+            }
+
+            public override void FillValue(int doc)
+            {
+                mval.Value = outerInstance.IntVal(doc);
+                mval.Exists = outerInstance.Exists(doc);
+            }
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
index da27a4c..18700b2 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/LongDocValues.cs
@@ -1,193 +1,187 @@
 using System;
+using Lucene.Net.Index;
+using Lucene.Net.Util.Mutable;
 
-namespace org.apache.lucene.queries.function.docvalues
+namespace Lucene.Net.Queries.Function.DocValues
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using IndexReader = org.apache.lucene.index.IndexReader;
-	using MutableValue = org.apache.lucene.util.mutable.MutableValue;
-	using MutableValueLong = org.apache.lucene.util.mutable.MutableValueLong;
-
-	/// <summary>
-	/// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving long values.
-	/// Implementations can control how the long values are loaded through <seealso cref="#longVal(int)"/>}
-	/// </summary>
-	public abstract class LongDocValues : FunctionValues
-	{
-	  protected internal readonly ValueSource vs;
-
-	  public LongDocValues(ValueSource vs)
-	  {
-		this.vs = vs;
-	  }
-
-	  public override sbyte byteVal(int doc)
-	  {
-		return (sbyte)longVal(doc);
-	  }
-
-	  public override short shortVal(int doc)
-	  {
-		return (short)longVal(doc);
-	  }
-
-	  public override float floatVal(int doc)
-	  {
-		return (float)longVal(doc);
-	  }
-
-	  public override int intVal(int doc)
-	  {
-		return (int)longVal(doc);
-	  }
-
-	  public override abstract long longVal(int doc);
-
-	  public override double doubleVal(int doc)
-	  {
-		return (double)longVal(doc);
-	  }
-
-	  public override bool boolVal(int doc)
-	  {
-		return longVal(doc) != 0;
-	  }
-
-	  public override string strVal(int doc)
-	  {
-		return Convert.ToString(longVal(doc));
-	  }
-
-	  public override object objectVal(int doc)
-	  {
-		return exists(doc) ? longVal(doc) : null;
-	  }
-
-	  public override string ToString(int doc)
-	  {
-		return vs.description() + '=' + strVal(doc);
-	  }
-
-	  protected internal virtual long externalToLong(string extVal)
-	  {
-		return Convert.ToInt64(extVal);
-	  }
-
-	  public override ValueSourceScorer getRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
-	  {
-		long lower, upper;
-
-		// instead of using separate comparison functions, adjust the endpoints.
-
-		if (lowerVal == null)
-		{
-		  lower = long.MinValue;
-		}
-		else
-		{
-		  lower = externalToLong(lowerVal);
-		  if (!includeLower && lower < long.MaxValue)
-		  {
-			  lower++;
-		  }
-		}
-
-		 if (upperVal == null)
-		 {
-		  upper = long.MaxValue;
-		 }
-		else
-		{
-		  upper = externalToLong(upperVal);
-		  if (!includeUpper && upper > long.MinValue)
-		  {
-			  upper--;
-		  }
-		}
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final long ll = lower;
-		long ll = lower;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final long uu = upper;
-		long uu = upper;
-
-		return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, ll, uu);
-	  }
-
-	  private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
-	  {
-		  private readonly LongDocValues outerInstance;
-
-		  private long ll;
-		  private long uu;
-
-		  public ValueSourceScorerAnonymousInnerClassHelper(LongDocValues outerInstance, IndexReader reader, org.apache.lucene.queries.function.docvalues.LongDocValues this, long ll, long uu) : base(reader, this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.ll = ll;
-			  this.uu = uu;
-		  }
-
-		  public override bool matchesValue(int doc)
-		  {
-			long val = outerInstance.longVal(doc);
-			// only check for deleted if it's the default value
-			// if (val==0 && reader.isDeleted(doc)) return false;
-			return val >= ll && val <= uu;
-		  }
-	  }
-
-	  public override ValueFiller ValueFiller
-	  {
-		  get
-		  {
-			return new ValueFillerAnonymousInnerClassHelper(this);
-		  }
-	  }
-
-	  private class ValueFillerAnonymousInnerClassHelper : ValueFiller
-	  {
-		  private readonly LongDocValues outerInstance;
-
-		  public ValueFillerAnonymousInnerClassHelper(LongDocValues outerInstance)
-		  {
-			  this.outerInstance = outerInstance;
-			  mval = new MutableValueLong();
-		  }
-
-		  private readonly MutableValueLong mval;
-
-		  public override MutableValue Value
-		  {
-			  get
-			  {
-				return mval;
-			  }
-		  }
-
-		  public override void fillValue(int doc)
-		  {
-			mval.value = outerInstance.longVal(doc);
-			mval.exists = outerInstance.exists(doc);
-		  }
-	  }
-	}
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving long values.
+    /// Implementations can control how the long values are loaded through <seealso cref="#LongVal(int)"/>}
+    /// </summary>
+    public abstract class LongDocValues : FunctionValues
+    {
+        protected internal readonly ValueSource vs;
+
+        protected LongDocValues(ValueSource vs)
+        {
+            this.vs = vs;
+        }
+
+        public override sbyte ByteVal(int doc)
+        {
+            return (sbyte)LongVal(doc);
+        }
+
+        public override short ShortVal(int doc)
+        {
+            return (short)LongVal(doc);
+        }
+
+        public override float FloatVal(int doc)
+        {
+            return (float)LongVal(doc);
+        }
+
+        public override int IntVal(int doc)
+        {
+            return (int)LongVal(doc);
+        }
+
+        public override abstract long LongVal(int doc);
+
+        public override double DoubleVal(int doc)
+        {
+            return (double)LongVal(doc);
+        }
+
+        public override bool BoolVal(int doc)
+        {
+            return LongVal(doc) != 0;
+        }
+
+        public override string StrVal(int doc)
+        {
+            return Convert.ToString(LongVal(doc));
+        }
+
+        public override object ObjectVal(int doc)
+        {
+            return Exists(doc) ? LongVal(doc) : (long?)null;
+        }
+
+        public override string ToString(int doc)
+        {
+            return vs.Description + '=' + StrVal(doc);
+        }
+
+        protected virtual long ExternalToLong(string extVal)
+        {
+            return Convert.ToInt64(extVal);
+        }
+
+        public override ValueSourceScorer GetRangeScorer(IndexReader reader, string lowerVal, string upperVal, bool includeLower, bool includeUpper)
+        {
+            long lower, upper;
+
+            // instead of using separate comparison functions, adjust the endpoints.
+
+            if (lowerVal == null)
+            {
+                lower = long.MinValue;
+            }
+            else
+            {
+                lower = ExternalToLong(lowerVal);
+                if (!includeLower && lower < long.MaxValue)
+                {
+                    lower++;
+                }
+            }
+
+            if (upperVal == null)
+            {
+                upper = long.MaxValue;
+            }
+            else
+            {
+                upper = ExternalToLong(upperVal);
+                if (!includeUpper && upper > long.MinValue)
+                {
+                    upper--;
+                }
+            }
+
+            long ll = lower;
+            long uu = upper;
+
+            return new ValueSourceScorerAnonymousInnerClassHelper(this, reader, this, ll, uu);
+        }
+
+        private class ValueSourceScorerAnonymousInnerClassHelper : ValueSourceScorer
+        {
+            private readonly LongDocValues outerInstance;
+
+            private long ll;
+            private long uu;
+
+            public ValueSourceScorerAnonymousInnerClassHelper(LongDocValues outerInstance, IndexReader reader, LongDocValues @this, long ll, long uu)
+                : base(reader, @this)
+            {
+                this.outerInstance = outerInstance;
+                this.ll = ll;
+                this.uu = uu;
+            }
+
+            public override bool MatchesValue(int doc)
+            {
+                long val = outerInstance.LongVal(doc);
+                // only check for deleted if it's the default value
+                // if (val==0 && reader.isDeleted(doc)) return false;
+                return val >= ll && val <= uu;
+            }
+        }
+
+        public override AbstractValueFiller ValueFiller
+        {
+            get
+            {
+                return new ValueFillerAnonymousInnerClassHelper(this);
+            }
+        }
+
+        private class ValueFillerAnonymousInnerClassHelper : AbstractValueFiller
+        {
+            private readonly LongDocValues outerInstance;
+
+            public ValueFillerAnonymousInnerClassHelper(LongDocValues outerInstance)
+            {
+                this.outerInstance = outerInstance;
+                mval = new MutableValueLong();
+            }
+
+            private readonly MutableValueLong mval;
+
+            public override MutableValue Value
+            {
+                get
+                {
+                    return mval;
+                }
+            }
+
+            public override void FillValue(int doc)
+            {
+                mval.Value = outerInstance.LongVal(doc);
+                mval.Exists = outerInstance.Exists(doc);
+            }
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs b/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
index ea3c450..41f520a 100644
--- a/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
+++ b/src/Lucene.Net.Queries/Function/DocValues/StrDocValues.cs
@@ -1,89 +1,87 @@
-namespace org.apache.lucene.queries.function.docvalues
-{
-
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
+using Lucene.Net.Util.Mutable;
 
-	using MutableValue = org.apache.lucene.util.mutable.MutableValue;
-	using MutableValueStr = org.apache.lucene.util.mutable.MutableValueStr;
+namespace Lucene.Net.Queries.Function.DocValues
+{
 
-	/// <summary>
-	/// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving String values.
-	/// Implementations can control how the String values are loaded through <seealso cref="#strVal(int)"/>}
-	/// </summary>
-	public abstract class StrDocValues : FunctionValues
-	{
-	  protected internal readonly ValueSource vs;
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Abstract <seealso cref="FunctionValues"/> implementation which supports retrieving String values.
+    /// Implementations can control how the String values are loaded through <seealso cref="#StrVal(int)"/>}
+    /// </summary>
+    public abstract class StrDocValues : FunctionValues
+    {
+        protected internal readonly ValueSource vs;
 
-	  public StrDocValues(ValueSource vs)
-	  {
-		this.vs = vs;
-	  }
+        public StrDocValues(ValueSource vs)
+        {
+            this.vs = vs;
+        }
 
-	  public override abstract string strVal(int doc);
+        public override abstract string StrVal(int doc);
 
-	  public override object objectVal(int doc)
-	  {
-		return exists(doc) ? strVal(doc) : null;
-	  }
+        public override object ObjectVal(int doc)
+        {
+            return Exists(doc) ? StrVal(doc) : null;
+        }
 
-	  public override bool boolVal(int doc)
-	  {
-		return exists(doc);
-	  }
+        public override bool BoolVal(int doc)
+        {
+            return Exists(doc);
+        }
 
-	  public override string ToString(int doc)
-	  {
-		return vs.description() + "='" + strVal(doc) + "'";
-	  }
+        public override string ToString(int doc)
+        {
+            return vs.Description + "='" + StrVal(doc) + "'";
+        }
 
-	  public override ValueFiller ValueFiller
-	  {
-		  get
-		  {
-			return new ValueFillerAnonymousInnerClassHelper(this);
-		  }
-	  }
+        public override AbstractValueFiller ValueFiller
+        {
+            get
+            {
+                return new ValueFillerAnonymousInnerClassHelper(this);
+            }
+        }
 
-	  private class ValueFillerAnonymousInnerClassHelper : ValueFiller
-	  {
-		  private readonly StrDocValues outerInstance;
+        private class ValueFillerAnonymousInnerClassHelper : AbstractValueFiller
+        {
+            private readonly StrDocValues outerInstance;
 
-		  public ValueFillerAnonymousInnerClassHelper(StrDocValues outerInstance)
-		  {
-			  this.outerInstance = outerInstance;
-			  mval = new MutableValueStr();
-		  }
+            public ValueFillerAnonymousInnerClassHelper(StrDocValues outerInstance)
+            {
+                this.outerInstance = outerInstance;
+                mval = new MutableValueStr();
+            }
 
-		  private readonly MutableValueStr mval;
+            private readonly MutableValueStr mval;
 
-		  public override MutableValue Value
-		  {
-			  get
-			  {
-				return mval;
-			  }
-		  }
+            public override MutableValue Value
+            {
+                get
+                {
+                    return mval;
+                }
+            }
 
-		  public override void fillValue(int doc)
-		  {
-			mval.exists = outerInstance.bytesVal(doc, mval.value);
-		  }
-	  }
-	}
+            public override void FillValue(int doc)
+            {
+                mval.Exists = outerInstance.BytesVal(doc, mval.Value);
+            }
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ba0f3c7d/src/Lucene.Net.Queries/Function/FunctionQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/FunctionQuery.cs b/src/Lucene.Net.Queries/Function/FunctionQuery.cs
index e0642f1..13044b3 100644
--- a/src/Lucene.Net.Queries/Function/FunctionQuery.cs
+++ b/src/Lucene.Net.Queries/Function/FunctionQuery.cs
@@ -1,270 +1,255 @@
 using System.Collections;
 using System.Collections.Generic;
+using Lucene.Net.Index;
+using Lucene.Net.Search;
+using Lucene.Net.Util;
+using org.apache.lucene.queries.function;
 
-namespace org.apache.lucene.queries.function
+namespace Lucene.Net.Queries.Function
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using AtomicReaderContext = org.apache.lucene.index.AtomicReaderContext;
-	using IndexReader = org.apache.lucene.index.IndexReader;
-	using Term = org.apache.lucene.index.Term;
-	using org.apache.lucene.search;
-	using MultiFields = org.apache.lucene.index.MultiFields;
-	using Bits = org.apache.lucene.util.Bits;
-
-
-
-	/// <summary>
-	/// Returns a score for each document based on a ValueSource,
-	/// often some function of the value of a field.
-	/// 
-	/// <b>Note: This API is experimental and may change in non backward-compatible ways in the future</b>
-	/// 
-	/// 
-	/// </summary>
-	public class FunctionQuery : Query
-	{
-	  internal readonly ValueSource func;
-
-	  /// <param name="func"> defines the function to be used for scoring </param>
-	  public FunctionQuery(ValueSource func)
-	  {
-		this.func = func;
-	  }
-
-	  /// <returns> The associated ValueSource </returns>
-	  public virtual ValueSource ValueSource
-	  {
-		  get
-		  {
-			return func;
-		  }
-	  }
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public Query rewrite(org.apache.lucene.index.IndexReader reader) throws java.io.IOException
-	  public override Query rewrite(IndexReader reader)
-	  {
-		return this;
-	  }
-
-	  public override void extractTerms(HashSet<Term> terms)
-	  {
-	  }
-
-	  protected internal class FunctionWeight : Weight
-	  {
-		  private readonly FunctionQuery outerInstance;
-
-		protected internal readonly IndexSearcher searcher;
-		protected internal float queryNorm;
-		protected internal float queryWeight;
-		protected internal readonly IDictionary context;
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public FunctionWeight(IndexSearcher searcher) throws java.io.IOException
-		public FunctionWeight(FunctionQuery outerInstance, IndexSearcher searcher)
-		{
-			this.outerInstance = outerInstance;
-		  this.searcher = searcher;
-		  this.context = ValueSource.newContext(searcher);
-		  outerInstance.func.createWeight(context, searcher);
-		}
-
-		public override Query Query
-		{
-			get
-			{
-			  return outerInstance;
-			}
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public float getValueForNormalization() throws java.io.IOException
-		public override float ValueForNormalization
-		{
-			get
-			{
-			  queryWeight = Boost;
-			  return queryWeight * queryWeight;
-			}
-		}
-
-		public override void normalize(float norm, float topLevelBoost)
-		{
-		  this.queryNorm = norm * topLevelBoost;
-		  queryWeight *= this.queryNorm;
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public Scorer scorer(org.apache.lucene.index.AtomicReaderContext context, org.apache.lucene.util.Bits acceptDocs) throws java.io.IOException
-		public override Scorer scorer(AtomicReaderContext context, Bits acceptDocs)
-		{
-		  return new AllScorer(outerInstance, context, acceptDocs, this, queryWeight);
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public Explanation explain(org.apache.lucene.index.AtomicReaderContext context, int doc) throws java.io.IOException
-		public override Explanation explain(AtomicReaderContext context, int doc)
-		{
-		  return ((AllScorer)scorer(context, context.reader().LiveDocs)).explain(doc);
-		}
-	  }
-
-	  protected internal class AllScorer : Scorer
-	  {
-		  private readonly FunctionQuery outerInstance;
-
-		internal readonly IndexReader reader;
-		internal readonly FunctionWeight weight;
-		internal readonly int maxDoc;
-		internal readonly float qWeight;
-		internal int doc = -1;
-		internal readonly FunctionValues vals;
-		internal readonly Bits acceptDocs;
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public AllScorer(org.apache.lucene.index.AtomicReaderContext context, org.apache.lucene.util.Bits acceptDocs, FunctionWeight w, float qWeight) throws java.io.IOException
-		public AllScorer(FunctionQuery outerInstance, AtomicReaderContext context, Bits acceptDocs, FunctionWeight w, float qWeight) : base(w)
-		{
-			this.outerInstance = outerInstance;
-		  this.weight = w;
-		  this.qWeight = qWeight;
-		  this.reader = context.reader();
-		  this.maxDoc = reader.maxDoc();
-		  this.acceptDocs = acceptDocs;
-		  vals = outerInstance.func.getValues(weight.context, context);
-		}
-
-		public override int docID()
-		{
-		  return doc;
-		}
-
-		// instead of matching all docs, we could also embed a query.
-		// the score could either ignore the subscore, or boost it.
-		// Containment:  floatline(foo:myTerm, "myFloatField", 1.0, 0.0f)
-		// Boost:        foo:myTerm^floatline("myFloatField",1.0,0.0f)
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public int nextDoc() throws java.io.IOException
-		public override int nextDoc()
-		{
-		  for (;;)
-		  {
-			++doc;
-			if (doc >= maxDoc)
-			{
-			  return doc = NO_MORE_DOCS;
-			}
-			if (acceptDocs != null && !acceptDocs.get(doc))
-			{
-				continue;
-			}
-			return doc;
-		  }
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public int advance(int target) throws java.io.IOException
-		public override int advance(int target)
-		{
-		  // this will work even if target==NO_MORE_DOCS
-		  doc = target - 1;
-		  return nextDoc();
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public float score() throws java.io.IOException
-		public override float score()
-		{
-		  float score = qWeight * vals.floatVal(doc);
-
-		  // Current Lucene priority queues can't handle NaN and -Infinity, so
-		  // map to -Float.MAX_VALUE. This conditional handles both -infinity
-		  // and NaN since comparisons with NaN are always false.
-		  return score > float.NegativeInfinity ? score : -float.MaxValue;
-		}
-
-		public override long cost()
-		{
-		  return maxDoc;
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public int freq() throws java.io.IOException
-		public override int freq()
-		{
-		  return 1;
-		}
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public Explanation explain(int doc) throws java.io.IOException
-		public virtual Explanation explain(int doc)
-		{
-		  float sc = qWeight * vals.floatVal(doc);
-
-		  Explanation result = new ComplexExplanation(true, sc, "FunctionQuery(" + outerInstance.func + "), product of:");
-
-		  result.addDetail(vals.explain(doc));
-		  result.addDetail(new Explanation(Boost, "boost"));
-		  result.addDetail(new Explanation(weight.queryNorm,"queryNorm"));
-		  return result;
-		}
-	  }
-
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public Weight createWeight(IndexSearcher searcher) throws java.io.IOException
-	  public override Weight createWeight(IndexSearcher searcher)
-	  {
-		return new FunctionQuery.FunctionWeight(this, searcher);
-	  }
-
-
-	  /// <summary>
-	  /// Prints a user-readable version of this query. </summary>
-	  public override string ToString(string field)
-	  {
-		float boost = Boost;
-		return (boost != 1.0?"(":"") + func.ToString() + (boost == 1.0 ? "" : ")^" + boost);
-	  }
-
-
-	  /// <summary>
-	  /// Returns true if <code>o</code> is equal to this. </summary>
-	  public override bool Equals(object o)
-	  {
-		if (!typeof(FunctionQuery).IsInstanceOfType(o))
-		{
-			return false;
-		}
-		FunctionQuery other = (FunctionQuery)o;
-		return this.Boost == other.Boost && this.func.Equals(other.func);
-	  }
-
-	  /// <summary>
-	  /// Returns a hash code value for this object. </summary>
-	  public override int GetHashCode()
-	  {
-		return func.GetHashCode() * 31 + float.floatToIntBits(Boost);
-	  }
-
-	}
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Returns a score for each document based on a ValueSource,
+    /// often some function of the value of a field.
+    /// 
+    /// <b>Note: This API is experimental and may change in non backward-compatible ways in the future</b>
+    /// 
+    /// 
+    /// </summary>
+    public class FunctionQuery : Query
+    {
+        internal readonly ValueSource func;
+
+        /// <param name="func"> defines the function to be used for scoring </param>
+        public FunctionQuery(ValueSource func)
+        {
+            this.func = func;
+        }
+
+        /// <returns> The associated ValueSource </returns>
+        public virtual ValueSource ValueSource
+        {
+            get
+            {
+                return func;
+            }
+        }
+
+        public override Query Rewrite(IndexReader reader)
+        {
+            return this;
+        }
+
+        public override void ExtractTerms(HashSet<Term> terms)
+        {
+        }
+
+        protected internal class FunctionWeight : Weight
+        {
+            private readonly FunctionQuery outerInstance;
+
+            protected internal readonly IndexSearcher searcher;
+            protected internal float queryNorm;
+            protected internal float queryWeight;
+            protected internal readonly IDictionary context;
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: public FunctionWeight(IndexSearcher searcher) throws java.io.IOException
+            public FunctionWeight(FunctionQuery outerInstance, IndexSearcher searcher)
+            {
+                this.outerInstance = outerInstance;
+                this.searcher = searcher;
+                this.context = ValueSource.newContext(searcher);
+                outerInstance.func.CreateWeight(context, searcher);
+            }
+
+            public override Query Query
+            {
+                get
+                {
+                    return outerInstance;
+                }
+            }
+
+            public override float ValueForNormalization
+            {
+                get
+                {
+                    queryWeight = Boost;
+                    return queryWeight * queryWeight;
+                }
+            }
+
+            public override void Normalize(float norm, float topLevelBoost)
+            {
+                this.queryNorm = norm * topLevelBoost;
+                queryWeight *= this.queryNorm;
+            }
+
+            public override Scorer Scorer(AtomicReaderContext context, Bits acceptDocs)
+            {
+                return new AllScorer(outerInstance, context, acceptDocs, this, queryWeight);
+            }
+
+            public override Explanation Explain(AtomicReaderContext context, int doc)
+            {
+                return ((AllScorer)Scorer(context, context.reader().LiveDocs)).Explain(doc);
+            }
+        }
+
+        protected internal class AllScorer : Scorer
+        {
+            private readonly FunctionQuery outerInstance;
+
+            internal readonly IndexReader reader;
+            internal readonly FunctionWeight weight;
+            internal readonly int maxDoc;
+            internal readonly float qWeight;
+            internal int doc = -1;
+            internal readonly FunctionValues vals;
+            internal readonly Bits acceptDocs;
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: public AllScorer(org.apache.lucene.index.AtomicReaderContext context, org.apache.lucene.util.Bits acceptDocs, FunctionWeight w, float qWeight) throws java.io.IOException
+            public AllScorer(FunctionQuery outerInstance, AtomicReaderContext context, Bits acceptDocs, FunctionWeight w, float qWeight)
+                : base(w)
+            {
+                this.outerInstance = outerInstance;
+                this.weight = w;
+                this.qWeight = qWeight;
+                this.reader = context.Reader;
+                this.maxDoc = reader.MaxDoc;
+                this.acceptDocs = acceptDocs;
+                vals = outerInstance.func.GetValues(weight.context, context);
+            }
+
+            public override int DocID()
+            {
+                return doc;
+            }
+
+            // instead of matching all docs, we could also embed a query.
+            // the score could either ignore the subscore, or boost it.
+            // Containment:  floatline(foo:myTerm, "myFloatField", 1.0, 0.0f)
+            // Boost:        foo:myTerm^floatline("myFloatField",1.0,0.0f)
+            public override int NextDoc()
+            {
+                for (; ; )
+                {
+                    ++doc;
+                    if (doc >= maxDoc)
+                    {
+                        return doc = NO_MORE_DOCS;
+                    }
+                    if (acceptDocs != null && !acceptDocs.Get(doc))
+                    {
+                        continue;
+                    }
+                    return doc;
+                }
+            }
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: @Override public int advance(int target) throws java.io.IOException
+            public override int Advance(int target)
+            {
+                // this will work even if target==NO_MORE_DOCS
+                doc = target - 1;
+                return NextDoc();
+            }
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: @Override public float score() throws java.io.IOException
+            public override float Score()
+            {
+                float score = qWeight * vals.FloatVal(doc);
+
+                // Current Lucene priority queues can't handle NaN and -Infinity, so
+                // map to -Float.MAX_VALUE. This conditional handles both -infinity
+                // and NaN since comparisons with NaN are always false.
+                return score > float.NegativeInfinity ? score : -float.MaxValue;
+            }
+
+            public override long Cost()
+            {
+                return maxDoc;
+            }
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: @Override public int freq() throws java.io.IOException
+            public override int Freq()
+            {
+                return 1;
+            }
+
+            //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+            //ORIGINAL LINE: public Explanation explain(int doc) throws java.io.IOException
+            public virtual Explanation Explain(int doc)
+            {
+                float sc = qWeight * vals.FloatVal(doc);
+
+                Explanation result = new ComplexExplanation(true, sc, "FunctionQuery(" + outerInstance.func + "), product of:");
+
+                result.AddDetail(vals.Explain(doc));
+                result.AddDetail(new Explanation(Boost, "boost"));
+                result.AddDetail(new Explanation(weight.queryNorm, "queryNorm"));
+                return result;
+            }
+        }
+
+
+        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+        //ORIGINAL LINE: @Override public Weight CreateWeight(IndexSearcher searcher) throws java.io.IOException
+        public override Weight CreateWeight(IndexSearcher searcher)
+        {
+            return new FunctionQuery.FunctionWeight(this, searcher);
+        }
+
+
+        /// <summary>
+        /// Prints a user-readable version of this query. </summary>
+        public override string ToString(string field)
+        {
+            float boost = Boost;
+            return (boost != 1.0 ? "(" : "") + func.ToString() + (boost == 1.0 ? "" : ")^" + boost);
+        }
+
+
+        /// <summary>
+        /// Returns true if <code>o</code> is equal to this. </summary>
+        public override bool Equals(object o)
+        {
+            if (!typeof(FunctionQuery).IsInstanceOfType(o))
+            {
+                return false;
+            }
+            FunctionQuery other = (FunctionQuery)o;
+            return this.Boost == other.Boost && this.func.Equals(other.func);
+        }
+
+        /// <summary>
+        /// Returns a hash code value for this object. </summary>
+        public override int GetHashCode()
+        {
+            return func.GetHashCode() * 31 + Number.FloatToIntBits(Boost);
+        }
+
+    }
 
 }
\ No newline at end of file


Mime
View raw message