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:29 UTC
[24/26] lucenenet git commit: Spatial: Refactor API members
Spatial: Refactor API members
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b680810a
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b680810a
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b680810a
Branch: refs/heads/master
Commit: b680810a379d9c3f6b27eb41b062322cdae46505
Parents: ad70ad8
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Fri Nov 18 02:37:54 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Fri Nov 25 17:58:43 2016 +0700
----------------------------------------------------------------------
.../Prefix/AbstractVisitingPrefixTreeFilter.cs | 6 ++--
.../Prefix/ContainsPrefixTreeFilter.cs | 16 +++++------
.../Prefix/IntersectsPrefixTreeFilter.cs | 4 +--
.../Prefix/PointPrefixTreeFieldCacheProvider.cs | 4 +--
.../Prefix/PrefixTreeStrategy.cs | 2 +-
src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs | 30 ++++++++++----------
.../Prefix/Tree/GeohashPrefixTree.cs | 19 +++++++------
.../Prefix/Tree/QuadPrefixTree.cs | 25 +++++++++-------
.../Prefix/Tree/SpatialPrefixTree.cs | 8 +++---
.../Prefix/Tree/SpatialPrefixTreeFactory.cs | 16 +++++------
.../Prefix/WithinPrefixTreeFilter.cs | 6 ++--
src/Lucene.Net.Spatial/Query/SpatialArgs.cs | 2 +-
.../Query/SpatialOperation.cs | 6 ++--
.../Prefix/SpatialOpRecursivePrefixTreeTest.cs | 2 +-
.../Prefix/Tree/SpatialPrefixTreeTest.cs | 6 ++--
15 files changed, 79 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/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 1286158..6afee2c 100644
--- a/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/AbstractVisitingPrefixTreeFilter.cs
@@ -280,7 +280,7 @@ namespace Lucene.Net.Spatial.Prefix
// then add all of those docs
Debug.Assert(StringHelper.StartsWith(thisTerm, curVNodeTerm));//TODO refactor to use method on curVNode.cell
scanCell = outerInstance.grid.GetCell(thisTerm.Bytes, thisTerm.Offset, thisTerm.Length, scanCell);
- if (scanCell.Level == cell.Level && scanCell.IsLeaf())
+ if (scanCell.Level == cell.Level && scanCell.IsLeaf)
{
VisitLeaf(scanCell);
//advance
@@ -356,12 +356,12 @@ namespace Lucene.Net.Spatial.Prefix
int termLevel = scanCell.Level;
if (termLevel < scanDetailLevel)
{
- if (scanCell.IsLeaf())
+ if (scanCell.IsLeaf)
VisitScanned(scanCell);
}
else if (termLevel == scanDetailLevel)
{
- if (!scanCell.IsLeaf())//LUCENE-5529
+ if (!scanCell.IsLeaf)//LUCENE-5529
VisitScanned(scanCell);
}
}//term loop
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
index ea10507..692722e 100644
--- a/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/ContainsPrefixTreeFilter.cs
@@ -99,10 +99,10 @@ namespace Lucene.Net.Spatial.Prefix
SmallDocSet combinedSubResults = null;
// Optimization: use null subCellsFilter when we know cell is within the query shape.
IShape subCellsFilter = outerInstance.queryShape;
- if (cell.Level != 0 && ((cell.GetShapeRel() == SpatialRelation.NULL_VALUE || cell.GetShapeRel() == SpatialRelation.WITHIN)))
+ if (cell.Level != 0 && ((cell.ShapeRel == SpatialRelation.NULL_VALUE || cell.ShapeRel == SpatialRelation.WITHIN)))
{
subCellsFilter = null;
- Debug.Assert(cell.GetShape().Relate(outerInstance.queryShape) == SpatialRelation.WITHIN);
+ Debug.Assert(cell.Shape.Relate(outerInstance.queryShape) == SpatialRelation.WITHIN);
}
ICollection<Cell> subCells = cell.GetSubCells(subCellsFilter);
foreach (Cell subCell in subCells)
@@ -116,7 +116,7 @@ namespace Lucene.Net.Spatial.Prefix
combinedSubResults = GetDocs(subCell, acceptContains);
}
else if (!outerInstance.multiOverlappingIndexedShapes &&
- subCell.GetShapeRel() == SpatialRelation.WITHIN)
+ subCell.ShapeRel == SpatialRelation.WITHIN)
{
combinedSubResults = GetLeafDocs(subCell, acceptContains); //recursion
}
@@ -178,7 +178,7 @@ namespace Lucene.Net.Spatial.Prefix
return null;
}
nextCell = outerInstance.grid.GetCell(nextTerm.Bytes, nextTerm.Offset, nextTerm.Length, this.nextCell);
- if (nextCell.Level == leafCell.Level && nextCell.IsLeaf())
+ if (nextCell.Level == leafCell.Level && nextCell.IsLeaf)
{
return CollectDocs(acceptContains);
}
@@ -248,9 +248,9 @@ namespace Lucene.Net.Spatial.Prefix
/// <summary>Number of docids.</summary>
/// <remarks>Number of docids.</remarks>
- public virtual int Size()
+ public virtual int Size
{
- return intSet.Size();
+ get { return intSet.Size(); }
}
/// <summary>NOTE: modifies and returns either "this" or "other"</summary>
@@ -284,7 +284,7 @@ namespace Lucene.Net.Spatial.Prefix
{
//if the # of docids is super small, return null since iteration is going
// to be faster
- return Size() > 4 ? this : null;
+ return Size > 4 ? this : null;
}
private sealed class _DocIdSetIterator_225 : DocIdSetIterator
@@ -336,7 +336,7 @@ namespace Lucene.Net.Spatial.Prefix
public override DocIdSetIterator GetIterator()
{
- if (Size() == 0)
+ if (Size == 0)
{
return null;
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/IntersectsPrefixTreeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/IntersectsPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/IntersectsPrefixTreeFilter.cs
index f5c288d..e9916e1 100644
--- a/src/Lucene.Net.Spatial/Prefix/IntersectsPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/IntersectsPrefixTreeFilter.cs
@@ -87,7 +87,7 @@ namespace Lucene.Net.Spatial.Prefix
protected internal override bool Visit(Cell cell)
{
- if (cell.GetShapeRel() == SpatialRelation.WITHIN || cell.Level == outerInstance.detailLevel)
+ if (cell.ShapeRel == SpatialRelation.WITHIN || cell.Level == outerInstance.detailLevel)
{
CollectDocs(results);
return false;
@@ -102,7 +102,7 @@ namespace Lucene.Net.Spatial.Prefix
protected internal override void VisitScanned(Cell cell)
{
- if (outerInstance.queryShape.Relate(cell.GetShape()).Intersects())
+ if (outerInstance.queryShape.Relate(cell.Shape).Intersects())
{
CollectDocs(results);
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs b/src/Lucene.Net.Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs
index f89da09..d4a2ef3 100644
--- a/src/Lucene.Net.Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs
+++ b/src/Lucene.Net.Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs
@@ -47,9 +47,9 @@ namespace Lucene.Net.Spatial.Prefix
protected internal override IPoint ReadShape(BytesRef term)
{
scanCell = grid.GetCell(term.Bytes, term.Offset, term.Length, scanCell);
- if (scanCell.Level == grid.MaxLevels && !scanCell.IsLeaf())
+ if (scanCell.Level == grid.MaxLevels && !scanCell.IsLeaf)
{
- return scanCell.GetCenter();
+ return scanCell.Center;
}
return null;
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs b/src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs
index 5176771..5bd7605 100644
--- a/src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs
+++ b/src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs
@@ -204,7 +204,7 @@ namespace Lucene.Net.Spatial.Prefix
Cell cell = iter.Current;
string token = cell.TokenString;
termAtt.Append(token);
- if (cell.IsLeaf())
+ if (cell.IsLeaf)
{
nextTokenStringNeedingLeaf = token;
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
index 57a04ca..1e5e488 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/Cell.cs
@@ -71,7 +71,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
protected internal Cell(SpatialPrefixTree outerInstance, string token)
{
// LUCENENET specific - set the outer instance here
- // because overrides of GetShape() may require it
+ // because overrides of Shape may require it
this.outerInstance = outerInstance;
//NOTE: must sort before letters & numbers
@@ -84,14 +84,14 @@ namespace Lucene.Net.Spatial.Prefix.Tree
}
if (Level == 0)
{
- GetShape();//ensure any lazy instantiation completes to make this threadsafe
+ var x = Shape;//ensure any lazy instantiation completes to make this threadsafe
}
}
protected internal Cell(SpatialPrefixTree outerInstance, byte[] bytes, int off, int len)
{
// LUCENENET specific - set the outer instance here
- // because overrides of GetShape() may require it
+ // because overrides of Shape may require it
this.outerInstance = outerInstance;
//ensure any lazy instantiation completes to make this threadsafe
@@ -126,9 +126,9 @@ namespace Lucene.Net.Spatial.Prefix.Tree
}
}
- public virtual SpatialRelation GetShapeRel()
+ public virtual SpatialRelation ShapeRel
{
- return shapeRel;
+ get { return shapeRel; }
}
/// <summary>For points, this is always false.</summary>
@@ -136,9 +136,9 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// For points, this is always false. Otherwise this is true if there are no
/// further cells with this prefix for the shape (always true at maxLevels).
/// </remarks>
- public virtual bool IsLeaf()
+ public virtual bool IsLeaf
{
- return leaf;
+ get { return leaf; }
}
/// <summary>Note: not supported at level 0.</summary>
@@ -152,7 +152,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// <summary>
/// Note: doesn't contain a trailing leaf byte.
/// </summary>
- public virtual String TokenString
+ public virtual string TokenString
{
get
{
@@ -202,7 +202,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// </see>
/// . The returned cells
/// should have
- /// <see cref="GetShapeRel()">GetShapeRel()</see>
+ /// <see cref="ShapeRel">ShapeRel</see>
/// set to their relation with
/// <code>shapeFilter</code>
/// . In addition,
@@ -236,7 +236,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
IList<Cell> copy = new List<Cell>(cells.Count);
foreach (Cell cell in cells)
{
- SpatialRelation rel = cell.GetShape().Relate(shapeFilter);
+ SpatialRelation rel = cell.Shape.Relate(shapeFilter);
if (rel == SpatialRelation.DISJOINT)
{
continue;
@@ -277,13 +277,13 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// <see cref="GetSubCells()">GetSubCells()</see>
/// .size() -- usually a constant. Should be >=2
/// </summary>
- public abstract int GetSubCellsSize();
+ public abstract int SubCellsSize { get; }
- public abstract IShape GetShape();
+ public abstract IShape Shape { get; }
- public virtual IPoint GetCenter()
+ public virtual IPoint Center
{
- return GetShape().Center;
+ get { return Shape.Center; }
}
#region IComparable<Cell> Members
@@ -310,7 +310,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
public override string ToString()
{
- return TokenString + (IsLeaf() ? ((char)LEAF_BYTE).ToString() : string.Empty);
+ return TokenString + (IsLeaf ? ((char)LEAF_BYTE).ToString() : string.Empty);
}
#endregion
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/Tree/GeohashPrefixTree.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/GeohashPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/GeohashPrefixTree.cs
index a11f47e..5dce614 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/GeohashPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/GeohashPrefixTree.cs
@@ -138,9 +138,9 @@ namespace Lucene.Net.Spatial.Prefix.Tree
return cells;
}
- public override int GetSubCellsSize()
+ public override int SubCellsSize
{
- return 32;//8x4
+ get { return 32; }//8x4
}
public override Cell GetSubCell(IPoint p)
@@ -150,18 +150,21 @@ namespace Lucene.Net.Spatial.Prefix.Tree
private IShape shape;//cache
- public override IShape GetShape()
+ public override IShape Shape
{
- if (shape == null)
+ get
{
- shape = GeohashUtils.DecodeBoundary(Geohash, outerInstance.ctx);
+ if (shape == null)
+ {
+ shape = GeohashUtils.DecodeBoundary(Geohash, outerInstance.ctx);
+ }
+ return shape;
}
- return shape;
}
- public override IPoint GetCenter()
+ public override IPoint Center
{
- return GeohashUtils.Decode(Geohash, outerInstance.ctx);
+ get { return GeohashUtils.Decode(Geohash, outerInstance.ctx); }
}
private string Geohash
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/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 1222d27..1e90dc2 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/QuadPrefixTree.cs
@@ -46,21 +46,21 @@ namespace Lucene.Net.Spatial.Prefix.Tree
{
protected internal override int GetLevelForDistance(double degrees)
{
- var grid = new QuadPrefixTree(ctx, MaxLevelsPossible);
+ var grid = new QuadPrefixTree(ctx, MAX_LEVELS_POSSIBLE);
return grid.GetLevelForDistance(degrees);
}
protected internal override SpatialPrefixTree NewSPT()
{
- return new QuadPrefixTree(ctx, maxLevels.HasValue ? maxLevels.Value : MaxLevelsPossible);
+ return new QuadPrefixTree(ctx, maxLevels.HasValue ? maxLevels.Value : MAX_LEVELS_POSSIBLE);
}
}
#endregion
- public const int MaxLevelsPossible = 50;//not really sure how big this should be
+ public const int MAX_LEVELS_POSSIBLE = 50;//not really sure how big this should be
- public const int DefaultMaxLevels = 12;
+ public const int DEFAULT_MAX_LEVELS = 12;
private readonly double xmin;
private readonly double xmax;
private readonly double ymin;
@@ -108,7 +108,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
}
public QuadPrefixTree(SpatialContext ctx)
- : this(ctx, DefaultMaxLevels)
+ : this(ctx, DEFAULT_MAX_LEVELS)
{
}
@@ -270,9 +270,9 @@ namespace Lucene.Net.Spatial.Prefix.Tree
return cells;
}
- public override int GetSubCellsSize()
+ public override int SubCellsSize
{
- return 4;
+ get { return 4; }
}
public override Cell GetSubCell(IPoint p)
@@ -282,13 +282,16 @@ namespace Lucene.Net.Spatial.Prefix.Tree
private IShape shape; //cache
- public override IShape GetShape()
+ public override IShape Shape
{
- if (shape == null)
+ get
{
- shape = MakeShape();
+ if (shape == null)
+ {
+ shape = MakeShape();
+ }
+ return shape;
}
- return shape;
}
private IRectangle MakeShape()
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
index 9e5f2a3..3fdac52 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTree.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
}
//TODO cache for each level
Cell cell = GetCell(ctx.WorldBounds.Center, level);
- IRectangle bbox = cell.GetShape().BoundingBox;
+ IRectangle bbox = cell.Shape.BoundingBox;
double width = bbox.Width;
double height = bbox.Height;
//Use standard cartesian hypotenuse. For geospatial, this answer is larger
@@ -222,7 +222,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
{
cell.SetLeaf();//FYI might already be a leaf
}
- if (cell.IsLeaf())
+ if (cell.IsLeaf)
{
result.Add(cell);
return true;
@@ -242,7 +242,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
}
}
//can we simplify?
- if (simplify && leaves == cell.GetSubCellsSize() && cell.Level != 0)
+ if (simplify && leaves == cell.SubCellsSize && cell.Level != 0)
{
//Optimization: substitute the parent as a leaf instead of adding all
// children as leaves
@@ -307,7 +307,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
foreach (Cell cell in cells)
{
string token = cell.TokenString;
- if (cell.IsLeaf())
+ if (cell.IsLeaf)
{
tokens.Add(token + (char)Cell.LEAF_BYTE);
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs
index a1905ca..34984b4 100644
--- a/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs
+++ b/src/Lucene.Net.Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs
@@ -32,10 +32,10 @@ namespace Lucene.Net.Spatial.Prefix.Tree
/// <lucene.experimental></lucene.experimental>
public abstract class SpatialPrefixTreeFactory
{
- private const double DefaultGeoMaxDetailKm = 0.001;//1m
- public const string PrefixTree = "prefixTree";
- public const string MaxLevels = "maxLevels";
- public const string MaxDistErr = "maxDistErr";
+ private const double DEFAULT_GEO_MAX_DETAIL_KM = 0.001;//1m
+ public const string PREFIX_TREE = "prefixTree";
+ public const string MAX_LEVELS = "maxLevels";
+ public const string MAX_DIST_ERR = "maxDistErr";
protected internal IDictionary<string, string> args;
protected internal SpatialContext ctx;
@@ -51,7 +51,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
{
SpatialPrefixTreeFactory instance;
string cname;
- if (!args.TryGetValue(PrefixTree, out cname))
+ if (!args.TryGetValue(PREFIX_TREE, out cname))
{
cname = ctx.IsGeo ? "geohash" : "quad";
}
@@ -89,21 +89,21 @@ namespace Lucene.Net.Spatial.Prefix.Tree
protected internal virtual void InitMaxLevels()
{
string mlStr;
- if (args.TryGetValue(MaxLevels, out mlStr))
+ if (args.TryGetValue(MAX_LEVELS, out mlStr))
{
maxLevels = int.Parse(mlStr, CultureInfo.InvariantCulture);
return;
}
double degrees;
string maxDetailDistStr;
- if (!args.TryGetValue(MaxDistErr, out maxDetailDistStr))
+ if (!args.TryGetValue(MAX_DIST_ERR, out maxDetailDistStr))
{
if (!ctx.IsGeo)
{
return;
}
//let default to max
- degrees = DistanceUtils.Dist2Degrees(DefaultGeoMaxDetailKm, DistanceUtils.EARTH_MEAN_RADIUS_KM);
+ degrees = DistanceUtils.Dist2Degrees(DEFAULT_GEO_MAX_DETAIL_KM, DistanceUtils.EARTH_MEAN_RADIUS_KM);
}
else
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs b/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
index f78dfb9..fc9f5b3 100644
--- a/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
+++ b/src/Lucene.Net.Spatial/Prefix/WithinPrefixTreeFilter.cs
@@ -185,7 +185,7 @@ namespace Lucene.Net.Spatial.Prefix
{
//cell.relate is based on the bufferedQueryShape; we need to examine what
// the relation is against the queryShape
- visitRelation = cell.GetShape().Relate(outerInstance.queryShape);
+ visitRelation = cell.Shape.Relate(outerInstance.queryShape);
if (visitRelation == SpatialRelation.WITHIN)
{
CollectDocs(inside);
@@ -209,7 +209,7 @@ namespace Lucene.Net.Spatial.Prefix
{
//visitRelation is declared as a field, populated by visit() so we don't recompute it
Debug.Assert(outerInstance.detailLevel != cell.Level);
- Debug.Assert(visitRelation == cell.GetShape().Relate(outerInstance.queryShape));
+ Debug.Assert(visitRelation == cell.Shape.Relate(outerInstance.queryShape));
if (AllCellsIntersectQuery(cell, visitRelation))
{
CollectDocs(inside);
@@ -232,7 +232,7 @@ namespace Lucene.Net.Spatial.Prefix
{
if (relate == SpatialRelation.NULL_VALUE)
{
- relate = cell.GetShape().Relate(outerInstance.queryShape);
+ relate = cell.Shape.Relate(outerInstance.queryShape);
}
if (cell.Level == outerInstance.detailLevel)
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Query/SpatialArgs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Query/SpatialArgs.cs b/src/Lucene.Net.Spatial/Query/SpatialArgs.cs
index 15dc0f1..7c49f5d 100644
--- a/src/Lucene.Net.Spatial/Query/SpatialArgs.cs
+++ b/src/Lucene.Net.Spatial/Query/SpatialArgs.cs
@@ -89,7 +89,7 @@ namespace Lucene.Net.Spatial.Queries
/// </summary>
public virtual void Validate()
{
- if (Operation.IsTargetNeedsArea && !Shape.HasArea)
+ if (Operation.TargetNeedsArea && !Shape.HasArea)
{
throw new ArgumentException(Operation + " only supports geometry with area");
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Spatial/Query/SpatialOperation.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Spatial/Query/SpatialOperation.cs b/src/Lucene.Net.Spatial/Query/SpatialOperation.cs
index ac1c9f3..a05703e 100644
--- a/src/Lucene.Net.Spatial/Query/SpatialOperation.cs
+++ b/src/Lucene.Net.Spatial/Query/SpatialOperation.cs
@@ -208,17 +208,17 @@ namespace Lucene.Net.Spatial.Queries
// ================================================= Getters / Setters =============================================
- public virtual bool IsScoreIsMeaningful
+ public virtual bool IsScoreMeaningful
{
get { return scoreIsMeaningful; }
}
- public virtual bool IsSourceNeedsArea
+ public virtual bool SourceNeedsArea
{
get { return sourceNeedsArea; }
}
- public virtual bool IsTargetNeedsArea
+ public virtual bool TargetNeedsArea
{
get { return targetNeedsArea; }
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Tests.Spatial/Prefix/SpatialOpRecursivePrefixTreeTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/Prefix/SpatialOpRecursivePrefixTreeTest.cs b/src/Lucene.Net.Tests.Spatial/Prefix/SpatialOpRecursivePrefixTreeTest.cs
index d73667d..d53f4a8 100644
--- a/src/Lucene.Net.Tests.Spatial/Prefix/SpatialOpRecursivePrefixTreeTest.cs
+++ b/src/Lucene.Net.Tests.Spatial/Prefix/SpatialOpRecursivePrefixTreeTest.cs
@@ -400,7 +400,7 @@ namespace Lucene.Net.Spatial.Prefix
List<IShape> cellShapes = new List<IShape>(cells.size());
foreach (Cell cell in cells)
{
- cellShapes.Add(cell.GetShape());
+ cellShapes.Add(cell.Shape);
}
return new ShapeCollection(cellShapes, ctx).BoundingBox;
}
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b680810a/src/Lucene.Net.Tests.Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs b/src/Lucene.Net.Tests.Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs
index 581b2f6..5dcc203 100644
--- a/src/Lucene.Net.Tests.Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs
+++ b/src/Lucene.Net.Tests.Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs
@@ -45,7 +45,7 @@ namespace Lucene.Net.Spatial.Prefix.Tree
Cell prevC = null;
Cell c = trie.WorldCell;
assertEquals(0, c.Level);
- assertEquals(ctx.WorldBounds, c.GetShape());
+ assertEquals(ctx.WorldBounds, c.Shape);
while (c.Level < trie.MaxLevels)
{
prevC = c;
@@ -56,8 +56,8 @@ namespace Lucene.Net.Spatial.Prefix.Tree
//c = c.GetSubCells().GetEnumerator().next();//TODO random which one?
assertEquals(prevC.Level + 1, c.Level);
- IRectangle prevNShape = (IRectangle)prevC.GetShape();
- IShape s = c.GetShape();
+ IRectangle prevNShape = (IRectangle)prevC.Shape;
+ IShape s = c.Shape;
IRectangle sbox = s.BoundingBox;
assertTrue(prevNShape.Width > sbox.Width);
assertTrue(prevNShape.Height > sbox.Height);