From c36c959a80bc2fd79ee1311db6f7a5b115baa0fd Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Mon, 16 Jul 2012 05:27:26 +0000 Subject: [PATCH] LUCENE-4197 remove 3 unused classes in the spatial module git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1361910 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/spatial/util/NumericFieldInfo.java | 49 ---------------- .../spatial/util/StringListTokenizer.java | 57 ------------------- .../lucene/spatial/util/TruncateFilter.java | 52 ----------------- 3 files changed, 158 deletions(-) delete mode 100644 lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java delete mode 100644 lucene/spatial/src/java/org/apache/lucene/spatial/util/StringListTokenizer.java delete mode 100644 lucene/spatial/src/java/org/apache/lucene/spatial/util/TruncateFilter.java 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 tokens; - private Iterator iter = null; - - public StringListTokenizer(Iterable 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; - } -}