Skip to content

Apache Lucene open-source search software

LUCENE-4197 remove 3 unused classes in the spatial module

David Wayne Smileyc36c959a80bc
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java b/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java
deleted file mode 100644
index c4d137e2f1d..00000000000
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.lucene.spatial.util;
-
-import org.apache.lucene.document.DoubleField;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.IndexableField;
-
-/**
- * Hold some of the parameters used by solr...
- * @lucene.experimental
- */
-public class NumericFieldInfo {
- public int precisionStep = 8; // same as solr default
- public boolean store = true;
- public boolean index = true;
-
- public void setPrecisionStep( int p ) {
- precisionStep = p;
- if (precisionStep<=0 || precisionStep>=64)
- precisionStep=Integer.MAX_VALUE;
- }
-
- public IndexableField createDouble( String name, double v ) {
- if (!store && !index)
- throw new IllegalArgumentException("field must be indexed or stored");
-
- FieldType fieldType = new FieldType(DoubleField.TYPE_NOT_STORED);
- fieldType.setStored(store);
- fieldType.setIndexed(index);
- fieldType.setNumericPrecisionStep(precisionStep);
- return new DoubleField(name,v,fieldType);
- }
-}
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/util/StringListTokenizer.java b/lucene/spatial/src/java/org/apache/lucene/spatial/util/StringListTokenizer.java
deleted file mode 100644
index eda4e86679a..00000000000
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/util/StringListTokenizer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.lucene.spatial.util;
-
-import org.apache.lucene.analysis.TokenStream;
-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.
- * @lucene.internal
- */
-public final class StringListTokenizer extends TokenStream {
-
- private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
-
- private final Iterable<String> tokens;
- private Iterator<String> iter = null;
-
- public StringListTokenizer(Iterable<String> tokens) {
- this.tokens = tokens;
- }
-
- @Override
- public boolean incrementToken() {
- if (iter.hasNext()) {
- clearAttributes();
- String t = iter.next();
- termAtt.append(t);
- return true;
- }
- return false;
- }
-
- @Override
- public void reset() throws IOException {
- super.reset();
- iter = tokens.iterator();
- }
-}
\ No newline at end of file
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/util/TruncateFilter.java b/lucene/spatial/src/java/org/apache/lucene/spatial/util/TruncateFilter.java
deleted file mode 100644
index 5c3553c9743..00000000000
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/util/TruncateFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.lucene.spatial.util;
-
-
-import org.apache.lucene.analysis.TokenFilter;
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-
-import java.io.IOException;
-
-/**
- * @lucene.internal
- */
-public class TruncateFilter extends TokenFilter {
-
- private final int maxTokenLength;
-
- private final CharTermAttribute termAttr = addAttribute(CharTermAttribute.class);
-
- public TruncateFilter(TokenStream in, int maxTokenLength) {
- super(in);
- this.maxTokenLength = maxTokenLength;
- }
-
- @Override
- public final boolean incrementToken() throws IOException {
- if (!input.incrementToken()) {
- return false;
- }
-
- if (termAttr.length() > maxTokenLength) {
- termAttr.setLength(maxTokenLength);
- }
- return true;
- }
-}