You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2016/11/25 11:07:27 UTC
[22/26] lucenenet git commit: Spatial: Removed commented code that
helped with the port
Spatial: Removed commented code that helped with the port
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/aa35405f
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/aa35405f
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/aa35405f
Branch: refs/heads/master
Commit: aa35405f94b5ffeef2357aa8e85b19fffa9d9b9b
Parents: d21093a
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Fri Nov 18 00:10:21 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Fri Nov 18 01:38:31 2016 +0700
----------------------------------------------------------------------
.../Prefix/AbstractVisitingPrefixTreeFilter.cs | 2 -
.../Prefix/Tree/QuadPrefixTree.cs | 4 -
.../Serialized/SerializedDVStrategy.cs | 115 -------------------
.../Util/DistanceToShapeValueSource.cs | 21 ----
.../Util/ShapeFieldCacheProvider.cs | 5 -
.../Util/ShapePredicateValueSource.cs | 20 ----
.../QueryEqualsHashCodeTest.cs | 23 ----
7 files changed, 190 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
index 42c76d1..1286158 100644
--- a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
@@ -435,8 +435,6 @@ namespace Lucene.Net.Spatial.Prefix
{
get
{
- //Debug.Assert(cellIter.Current != null);
- //vNode.Reset(cellIter.Current);
return vNode;
}
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
index 74dd43d..1222d27 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
@@ -121,10 +121,6 @@ namespace Lucene.Net.Spatial.Prefix.Tree
{
// Format the number to min 3 integer digits and exactly 5 fraction digits
const string FORMAT_STR = @"000.00000";
- /*NumberFormat nf = NumberFormat.GetNumberInstance(CultureInfo.Root);
- nf.SetMaximumFractionDigits(5);
- nf.SetMinimumFractionDigits(5);
- nf.SetMinimumIntegerDigits(3);*/
for (int i = 0; i < maxLevels; i++)
{
@out.WriteLine(i + "]\t" + levelW[i].ToString(FORMAT_STR) + "\t" + levelH[i].ToString(FORMAT_STR) + "\t" +
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
index ca383e9..33926ee 100644
--- a/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
+++ b/src/Lucene.Net.Spatial/Serialized/SerializedDVStrategy.cs
@@ -69,17 +69,6 @@ namespace Lucene.Net.Spatial.Serialized
//this is a hack to avoid redundant byte array copying by byteStream.toByteArray()
byteStream.WriteTo(new OutputStreamAnonymousHelper(bytesRef));
-
-
- // byteStream.WriteTo(new FilterOutputStream(null/*not used*/) {
- // @Override
- // public void write(byte[] b, int off, int len) throws IOException
- // {
- // bytesRef.bytes = b;
- // bytesRef.offset = off;
- // bytesRef.length = len;
- // }
- //});
}
catch (IOException e)
{
@@ -157,42 +146,6 @@ namespace Lucene.Net.Spatial.Serialized
public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
{
return new DocIdSetAnonymousHelper(this, context, acceptDocs);
-
- // return new DocIdSet()
- // {
- // @Override
- // public DocIdSetIterator iterator() throws IOException
- // {
- // throw new UnsupportedOperationException(
- // "Iteration is too slow; instead try FilteredQuery.QUERY_FIRST_FILTER_STRATEGY");
- // //Note that if you're truly bent on doing this, then see FunctionValues.getRangeScorer
- // }
-
- // @Override
- // public Bits bits() throws IOException
- // {
- // //null Map context -- we simply don't have one. That's ok.
- // final FunctionValues predFuncValues = predicateValueSource.getValues(null, context);
-
- // return new Bits()
- // {
-
- // @Override
- // public boolean get(int index)
- // {
- // if (acceptDocs != null && !acceptDocs.get(index))
- // return false;
- // return predFuncValues.boolVal(index);
- // }
-
- // @Override
- // public int length()
- // {
- // return context.reader().maxDoc();
- // }
- //};
- // }
- //};
}
internal class DocIdSetAnonymousHelper : DocIdSet
@@ -293,74 +246,6 @@ namespace Lucene.Net.Spatial.Serialized
BinaryDocValues docValues = readerContext.AtomicReader.GetBinaryDocValues(fieldName);
return new FuctionValuesAnonymousHelper(this, docValues);
-
- // return new FunctionValues()
- //{
- // int bytesRefDoc = -1;
- // BytesRef bytesRef = new BytesRef();//scratch
-
- // bool fillBytes(int doc) {
- // if (bytesRefDoc != doc)
- // {
- // docValues.Get(doc, bytesRef);
- // bytesRefDoc = doc;
- // }
- // return bytesRef.length != 0;
- // }
-
- // @Override
- // public boolean exists(int doc)
- //{
- // return fillBytes(doc);
- //}
-
- //@Override
- // public boolean bytesVal(int doc, BytesRef target)
- //{
- // if (fillBytes(doc))
- // {
- // target.bytes = bytesRef.bytes;
- // target.offset = bytesRef.offset;
- // target.length = bytesRef.length;
- // return true;
- // }
- // else
- // {
- // target.length = 0;
- // return false;
- // }
- //}
-
- //@Override
- // public Object objectVal(int docId)
- //{
- // if (!fillBytes(docId))
- // return null;
- // DataInputStream dataInput = new DataInputStream(
- // new ByteArrayInputStream(bytesRef.bytes, bytesRef.offset, bytesRef.length));
- // try
- // {
- // return binaryCodec.readShape(dataInput);
- // }
- // catch (IOException e)
- // {
- // throw new RuntimeException(e);
- // }
- //}
-
- //@Override
- // public Explanation explain(int doc)
- //{
- // return new Explanation(Float.NaN, toString(doc));
- //}
-
- //@Override
- // public String toString(int doc)
- //{
- // return description() + "=" + objectVal(doc);//TODO truncate?
- //}
-
- // };
}
internal class FuctionValuesAnonymousHelper : FunctionValues
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs b/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs
index 76fc7bd..c108e54 100644
--- a/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs
+++ b/src/Lucene.Net.Spatial/Util/DistanceToShapeValueSource.cs
@@ -70,27 +70,6 @@ namespace Lucene.Net.Spatial.Util
FunctionValues shapeValues = shapeValueSource.GetValues(context, readerContext);
return new DoubleDocValuesAnonymousHelper(this, shapeValues);
-
- //return new DoubleDocValues(this)
- // {
- // @Override
- // public double doubleVal(int doc)
- // {
- // Shape shape = (Shape)shapeValues.objectVal(doc);
- // if (shape == null || shape.isEmpty())
- // return nullValue;
- // Point pt = shape.getCenter();
- // return distCalc.distance(queryPoint, pt) * multiplier;
- // }
-
- // @Override
- // public Explanation explain(int doc)
- // {
- // Explanation exp = super.explain(doc);
- // exp.addDetail(shapeValues.explain(doc));
- // return exp;
- // }
- //};
}
internal class DoubleDocValuesAnonymousHelper : DoubleDocValues
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs b/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs
index 8e8dbc8..4fba809 100644
--- a/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs
+++ b/src/Lucene.Net.Spatial/Util/ShapeFieldCacheProvider.cs
@@ -39,13 +39,8 @@ namespace Lucene.Net.Spatial.Util
{
//private Logger log = Logger.GetLogger(GetType().FullName);
-#if !NET35
private readonly WeakDictionary<IndexReader, ShapeFieldCache<T>> sidx =
new WeakDictionary<IndexReader, ShapeFieldCache<T>>();
-#else
- private readonly WeakDictionary<IndexReader, ShapeFieldCache<T>> sidx =
- new WeakDictionary<IndexReader, ShapeFieldCache<T>>();
-#endif
protected internal readonly int defaultSize;
protected internal readonly string shapeField;
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs b/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs
index 7f65893..8914343 100644
--- a/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs
+++ b/src/Lucene.Net.Spatial/Util/ShapePredicateValueSource.cs
@@ -70,26 +70,6 @@ namespace Lucene.Net.Spatial.Util
FunctionValues shapeValues = shapeValuesource.GetValues(context, readerContext);
return new BoolDocValuesAnonymousHelper(this, shapeValues);
-
- //return new BoolDocValues(this)
- // {
- // @Override
- // public boolean boolVal(int doc)
- // {
- // Shape indexedShape = (Shape)shapeValues.objectVal(doc);
- // if (indexedShape == null)
- // return false;
- // return op.evaluate(indexedShape, queryShape);
- // }
-
- // @Override
- // public Explanation explain(int doc)
- // {
- // Explanation exp = super.explain(doc);
- // exp.addDetail(shapeValues.explain(doc));
- // return exp;
- // }
- //};
}
internal class BoolDocValuesAnonymousHelper : BoolDocValues
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aa35405f/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs b/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs
index 25db926..33417b5 100644
--- a/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs
+++ b/src/Lucene.Net.Tests.Spatial/QueryEqualsHashCodeTest.cs
@@ -102,31 +102,8 @@ namespace Lucene.Net.Spatial
SpatialArgs args1 = MakeArgs1();
SpatialArgs args2 = MakeArgs2();
TestEqualsHashcode(args1, args2, new ObjGeneratorQueryAnonymousHelper(strategy));
- // testEqualsHashcode(args1, args2, new ObjGenerator() {
- // @Override
- // public Object gen(SpatialArgs args)
- // {
- // return strategy.makeQuery(args);
- // }
- //});
TestEqualsHashcode(args1, args2, new ObjGeneratorFilterAnonymousHelper(strategy));
- // testEqualsHashcode(args1, args2, new ObjGenerator()
- // {
- // @Override
- // public Object gen(SpatialArgs args)
- // {
- // return strategy.makeFilter(args);
- // }
- //});
TestEqualsHashcode(args1, args2, new ObjGeneratorDistanceValueSourceAnonymousHelper(strategy));
- // testEqualsHashcode(args1, args2, new ObjGenerator()
- //{
- // @Override
- // public Object gen(SpatialArgs args)
- //{
- // return strategy.makeDistanceValueSource(args.getShape().getCenter());
- //}
- // });
}
private void TestEqualsHashcode(SpatialArgs args1, SpatialArgs args2, ObjGenerator generator)