Refactored away the ".strategy" sub-package name. No need since spatial4j exists.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3795_lsp_spatial_module@1296054 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2012-03-02 05:26:00 +00:00
parent fdb0bd695e
commit c2c2b23e9d
36 changed files with 112 additions and 122 deletions

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy;
package org.apache.lucene.spatial;
public class SimpleSpatialFieldInfo implements SpatialFieldInfo {

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy;
package org.apache.lucene.spatial;
/**
* Information the strategy needs for the lucene fields

View File

@ -15,15 +15,15 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy;
package org.apache.lucene.spatial;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.Query;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.shape.Shape;
/**
* must be thread safe

View File

@ -22,5 +22,5 @@
* Check:
* http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves
*/
package org.apache.lucene.spatial.strategy;
package org.apache.lucene.spatial;

View File

@ -15,13 +15,12 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import com.spatial4j.core.shape.Point;
import org.apache.lucene.spatial.strategy.prefix.tree.Node;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.spatial.strategy.util.ShapeFieldCacheProvider;
import org.apache.lucene.spatial.prefix.tree.Node;
import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.spatial.util.ShapeFieldCacheProvider;
import org.apache.lucene.util.BytesRef;
public class PointPrefixTreeFieldCacheProvider extends ShapeFieldCacheProvider<Point> {

View File

@ -15,14 +15,14 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
import java.io.IOException;
import java.io.Reader;
package org.apache.lucene.spatial.prefix;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.IOException;
import java.io.Reader;
/**
*

View File

@ -15,8 +15,12 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.document.Field;
@ -24,15 +28,11 @@ import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.ValueSource;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.SpatialStrategy;
import org.apache.lucene.spatial.strategy.prefix.tree.Node;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.spatial.strategy.util.CachedDistanceValueSource;
import org.apache.lucene.spatial.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.SpatialStrategy;
import org.apache.lucene.spatial.prefix.tree.Node;
import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.spatial.util.CachedDistanceValueSource;
import java.io.IOException;
import java.util.Iterator;

View File

@ -15,17 +15,16 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import com.spatial4j.core.shape.Shape;
import com.spatial4j.core.shape.SpatialRelation;
import org.apache.lucene.index.*;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Filter;
import org.apache.lucene.spatial.strategy.prefix.tree.Node;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import com.spatial4j.core.shape.SpatialRelation;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.prefix.tree.Node;
import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.OpenBitSet;

View File

@ -15,19 +15,19 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.FilteredQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.FunctionQuery;
import com.spatial4j.core.exception.UnsupportedSpatialOperation;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.query.SpatialOperation;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.FilteredQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.spatial.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
public class RecursivePrefixTreeStrategy extends PrefixTreeStrategy {

View File

@ -15,17 +15,17 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.*;
import com.spatial4j.core.exception.UnsupportedSpatialOperation;
import com.spatial4j.core.query.SpatialArgs;
import com.spatial4j.core.query.SpatialOperation;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.tree.Node;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.*;
import org.apache.lucene.spatial.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.prefix.tree.Node;
import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
import java.util.List;

View File

@ -18,5 +18,5 @@
/**
* Prefix Tree Strategy
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.shape.Point;

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.shape.SpatialRelation;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Shape;
import com.spatial4j.core.shape.SpatialRelation;
import java.util.ArrayList;
import java.util.Collection;

View File

@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.shape.SpatialRelation;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
import com.spatial4j.core.shape.SpatialRelation;
import com.spatial4j.core.shape.simple.PointImpl;
import java.text.NumberFormat;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.shape.Point;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.distance.DistanceUnits;

View File

@ -24,5 +24,5 @@
* * http://en.wikipedia.org/wiki/Geohash
* * http://healpix.jpl.nasa.gov/
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;

View File

@ -15,15 +15,15 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.shape.Point;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.shape.Point;
import java.io.IOException;
import java.util.List;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.lucene.index.AtomicReaderContext;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import org.apache.lucene.document.DoubleField;
import org.apache.lucene.document.FieldType;

View File

@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import com.spatial4j.core.shape.Shape;
import java.util.ArrayList;
import java.util.List;
import com.spatial4j.core.shape.Shape;
public class ShapeFieldCache<T extends Shape> {
private List<T>[] cache;
public int defaultLength;

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.index.*;
import org.apache.lucene.search.DocIdSetIterator;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.util.BytesRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -15,16 +15,14 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
import java.io.IOException;
import java.io.Reader;
import java.util.Iterator;
package org.apache.lucene.spatial.util;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.IOException;
import java.util.Iterator;
/**
* Put a list of strings directly into the token stream
*/

View File

@ -15,15 +15,15 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import java.io.IOException;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import java.io.IOException;
public class TruncateFilter extends TokenFilter {
private final int maxTokenLength;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.util;
package org.apache.lucene.spatial.util;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.queries.function.FunctionValues;

View File

@ -15,8 +15,11 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.vector;
package org.apache.lucene.spatial.vector;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.simple.PointImpl;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.lucene.index.AtomicReader;
@ -25,9 +28,6 @@ import org.apache.lucene.queries.function.FunctionValues;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.FieldCache.DoubleParser;
import com.spatial4j.core.distance.DistanceCalculator;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.simple.PointImpl;
import org.apache.lucene.util.Bits;
import java.io.IOException;

View File

@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.vector;
package org.apache.lucene.spatial.vector;
import org.apache.lucene.spatial.strategy.SpatialFieldInfo;
import org.apache.lucene.spatial.SpatialFieldInfo;
public class TwoDoublesFieldInfo implements SpatialFieldInfo {

View File

@ -15,15 +15,8 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.vector;
package org.apache.lucene.spatial.vector;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.*;
import org.apache.lucene.search.FieldCache.DoubleParser;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.exception.InvalidShapeException;
import com.spatial4j.core.exception.UnsupportedSpatialOperation;
@ -33,10 +26,17 @@ import com.spatial4j.core.shape.Circle;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.SpatialStrategy;
import org.apache.lucene.spatial.strategy.util.CachingDoubleValueSource;
import org.apache.lucene.spatial.strategy.util.NumericFieldInfo;
import org.apache.lucene.spatial.strategy.util.ValueSourceFilter;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.*;
import org.apache.lucene.search.FieldCache.DoubleParser;
import org.apache.lucene.spatial.SpatialStrategy;
import org.apache.lucene.spatial.util.CachingDoubleValueSource;
import org.apache.lucene.spatial.util.NumericFieldInfo;
import org.apache.lucene.spatial.util.ValueSourceFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -18,18 +18,16 @@
package org.apache.lucene.spatial;
import junit.framework.Assert;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexableField;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.io.sample.SampleData;
import com.spatial4j.core.io.sample.SampleDataReader;
import com.spatial4j.core.query.SpatialArgsParser;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.SpatialFieldInfo;
import org.apache.lucene.spatial.strategy.SpatialStrategy;
import junit.framework.Assert;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexableField;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import com.spatial4j.core.context.SpatialContext;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.tree.GeohashPrefixTree;
import org.apache.lucene.spatial.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.SpatialMatchConcern;
import org.apache.lucene.spatial.StrategyTestCase;
import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree;
import org.junit.Test;
import java.io.IOException;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.context.simple.SimpleSpatialContext;

View File

@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
/**
* This is just a quick idea for *simple* tests

View File

@ -15,19 +15,19 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix;
package org.apache.lucene.spatial.prefix;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.context.simple.SimpleSpatialContext;
import com.spatial4j.core.query.SpatialArgsParser;
import com.spatial4j.core.shape.Shape;
import com.spatial4j.core.shape.simple.PointImpl;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.tree.QuadPrefixTree;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.spatial.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.SpatialTestCase;
import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree;
import org.junit.Test;
import java.io.IOException;

View File

@ -15,15 +15,11 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.prefix.tree;
package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.context.simple.SimpleSpatialContext;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.strategy.prefix.tree.GeohashPrefixTree;
import org.apache.lucene.spatial.strategy.prefix.tree.Node;
import org.apache.lucene.spatial.strategy.prefix.tree.SpatialPrefixTree;
import org.junit.Before;
import org.junit.Test;

View File

@ -15,13 +15,13 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.vector;
package org.apache.lucene.spatial.vector;
import org.apache.lucene.search.FieldCache;
import com.spatial4j.core.context.SpatialContext;
import org.apache.lucene.spatial.strategy.util.NumericFieldInfo;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.spatial.SpatialMatchConcern;
import org.apache.lucene.spatial.StrategyTestCase;
import org.apache.lucene.spatial.util.NumericFieldInfo;
import org.junit.Test;
import java.io.IOException;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.spatial.strategy.vector;
package org.apache.lucene.spatial.vector;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.context.simple.SimpleSpatialContext;