LUCENE-1970: Remove deprecated DocIdSetIterator methods.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@824111 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2009-10-11 17:17:40 +00:00
parent ad692ba1c0
commit 35f0f926a2
26 changed files with 10 additions and 485 deletions

View File

@ -41,6 +41,9 @@ API Changes
* LUCENE-1968: Remove deprecated methods in PriorityQueue. (Michael Busch)
* LUCENE-1970: Remove deprecated methods in DocIdSetIterator and make
new ones abstract. (Michael Busch)
Bug fixes
* LUCENE-1951: When the text provided to WildcardQuery has no wildcard

View File

@ -116,23 +116,14 @@ final class BooleanScorer extends Scorer {
public int advance(int target) throws IOException { return NO_MORE_DOCS; }
/** @deprecated use {@link #docID()} instead. */
public int doc() { return doc; }
public int docID() { return doc; }
public Explanation explain(int doc) throws IOException { return null; }
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException { return false; }
public int nextDoc() throws IOException { return NO_MORE_DOCS; }
public float score() throws IOException { return score; }
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException { return false; }
}
static final class Bucket {
@ -289,9 +280,6 @@ final class BooleanScorer extends Scorer {
throw new UnsupportedOperationException();
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return current.doc; }
public int docID() {
return doc;
}
@ -300,11 +288,6 @@ final class BooleanScorer extends Scorer {
throw new UnsupportedOperationException();
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
boolean more;
do {
@ -351,11 +334,6 @@ final class BooleanScorer extends Scorer {
score(new HitCollectorWrapper(hc));
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) {
throw new UnsupportedOperationException();
}
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("boolean(");

View File

@ -124,24 +124,12 @@ class BooleanScorer2 extends Scorer {
}
return lastDocScore;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return scorer.doc();
}
public int docID() {
return scorer.docID();
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return scorer.nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return scorer.nextDoc();
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int docNr) throws IOException {
return scorer.advance(docNr) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
return scorer.advance(target);
}
@ -316,18 +304,10 @@ class BooleanScorer2 extends Scorer {
return doc != NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return countingSumScorer.doc(); }
public int docID() {
return doc;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return doc = countingSumScorer.nextDoc();
}
@ -338,11 +318,6 @@ class BooleanScorer2 extends Scorer {
return sum * coordinator.coordFactors[coordinator.nrMatchers];
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
return doc = countingSumScorer.advance(target);
}

View File

@ -109,9 +109,6 @@ class ConjunctionScorer extends Scorer {
return lastDoc = doNext();
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return lastDoc; }
public int docID() {
return lastDoc;
}
@ -120,11 +117,6 @@ class ConjunctionScorer extends Scorer {
throw new UnsupportedOperationException();
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (lastDoc == NO_MORE_DOCS) {
return lastDoc;
@ -142,10 +134,4 @@ class ConjunctionScorer extends Scorer {
}
return sum * coord;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
}

View File

@ -123,20 +123,10 @@ public class ConstantScoreQuery extends Query {
}
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return docIdSetIterator.nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return docIdSetIterator.nextDoc();
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return docIdSetIterator.doc();
}
public int docID() {
return docIdSetIterator.docID();
}
@ -145,11 +135,6 @@ public class ConstantScoreQuery extends Query {
return theScore;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return docIdSetIterator.advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
return docIdSetIterator.advance(target);
}

View File

@ -62,16 +62,6 @@ class DisjunctionMaxScorer extends Scorer {
heapify();
}
/**
* Generate the next document matching our associated DisjunctionMaxQuery.
*
* @return true iff there is a next document
* @deprecated use {@link #nextDoc()} instead.
*/
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (numScorers == 0) return doc = NO_MORE_DOCS;
while (subScorers[0].docID() == doc) {
@ -88,11 +78,6 @@ class DisjunctionMaxScorer extends Scorer {
return doc = subScorers[0].docID();
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return subScorers[0].doc();
}
public int docID() {
return doc;
}
@ -120,20 +105,6 @@ class DisjunctionMaxScorer extends Scorer {
}
}
/**
* Advance to the first document beyond the current whose number is greater
* than or equal to target.
*
* @param target
* the minimum number of the next desired document
* @return true iff there is a document to be generated whose number is at
* least target
* @deprecated use {@link #advance(int)} instead.
*/
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
if (numScorers == 0) return doc = NO_MORE_DOCS;
while (subScorers[0].docID() < target) {

View File

@ -161,11 +161,6 @@ class DisjunctionSumScorer extends Scorer {
return true;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (scorerDocQueue.size() < minimumNrMatchers || !advanceAfterCurrent()) {
currentDoc = NO_MORE_DOCS;
@ -222,9 +217,6 @@ class DisjunctionSumScorer extends Scorer {
*/
public float score() throws IOException { return currentScore; }
/** @deprecated use {@link #docID()} instead. */
public int doc() { return currentDoc; }
public int docID() {
return currentDoc;
}
@ -236,22 +228,6 @@ class DisjunctionSumScorer extends Scorer {
return nrMatchers;
}
/**
* Skips to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>
* When this method is used the {@link #explain(int)} method should not be
* used. <br>
* The implementation uses the skipTo() method on the subscorers.
*
* @param target
* The target document number.
* @return true iff there is such a match.
* @deprecated use {@link #advance(int)} instead.
*/
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
/**
* Advances to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>

View File

@ -28,7 +28,6 @@ import java.io.IOException;
*/
public abstract class DocIdSetIterator {
// TODO (3.0): review the javadocs and remove any references to '3.0'.
private int doc = -1;
/**
@ -37,16 +36,6 @@ public abstract class DocIdSetIterator {
*/
public static final int NO_MORE_DOCS = Integer.MAX_VALUE;
/**
* Unsupported anymore. Call {@link #docID()} instead. This method throws
* {@link UnsupportedOperationException} if called.
*
* @deprecated use {@link #docID()} instead.
*/
public int doc() {
throw new UnsupportedOperationException("Call docID() instead.");
}
/**
* Returns the following:
* <ul>
@ -56,56 +45,22 @@ public abstract class DocIdSetIterator {
* <li>Otherwise it should return the doc ID it is currently on.
* </ul>
* <p>
* <b>NOTE:</b> in 3.0, this method will become abstract.
*
* @since 2.9
*/
public int docID() {
return doc;
}
/**
* Unsupported anymore. Call {@link #nextDoc()} instead. This method throws
* {@link UnsupportedOperationException} if called.
*
* @deprecated use {@link #nextDoc()} instead. This will be removed in 3.0
*/
public boolean next() throws IOException {
throw new UnsupportedOperationException("Call nextDoc() instead.");
}
/**
* Unsupported anymore. Call {@link #advance(int)} instead. This method throws
* {@link UnsupportedOperationException} if called.
*
* @deprecated use {@link #advance(int)} instead. This will be removed in 3.0
*/
public boolean skipTo(int target) throws IOException {
throw new UnsupportedOperationException("Call advance() instead.");
}
public abstract int docID();
/**
* Advances to the next document in the set and returns the doc it is
* currently on, or {@link #NO_MORE_DOCS} if there are no more docs in the
* set.<br>
*
* <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
* of {@link #next()}. For backward compatibility it is implemented as:
*
* <pre>
* public int nextDoc() throws IOException {
* return next() ? doc() : NO_MORE_DOCS;
* }
* </pre>
*
* <b>NOTE:</b> after the iterator has exhausted you should not call this
* method, as it may result in unpredicted behavior.
*
* @since 2.9
*/
public int nextDoc() throws IOException {
return doc = next() ? doc() : NO_MORE_DOCS;
}
public abstract int nextDoc() throws IOException;
/**
* Advances to the first beyond the current whose document number is greater
@ -136,16 +91,9 @@ public abstract class DocIdSetIterator {
* <b>NOTE:</b> after the iterator has exhausted you should not call this
* method, as it may result in unpredicted behavior.
* <p>
* <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
* of {@link #skipTo(int)}.
*
* @since 2.9
*/
public int advance(int target) throws IOException {
if (target == NO_MORE_DOCS) {
return doc = NO_MORE_DOCS;
}
return doc = skipTo(target) ? doc() : NO_MORE_DOCS;
}
public abstract int advance(int target) throws IOException;
}

View File

@ -496,21 +496,6 @@ public abstract class FieldCacheRangeFilter extends Filter {
return new DocIdSetIterator() {
private int doc = -1;
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return termDocs.doc();
}
public int docID() {
return doc;
}
@ -539,21 +524,6 @@ public abstract class FieldCacheRangeFilter extends Filter {
return new DocIdSetIterator() {
private int doc = -1;
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return doc;
}
public int docID() {
return doc;
}

View File

@ -138,20 +138,10 @@ public class FieldCacheTermsFilter extends Filter {
protected class FieldCacheTermsFilterDocIdSetIterator extends DocIdSetIterator {
private int doc = -1;
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return doc;
}
public int docID() {
return doc;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() {
try {
while (!openBitSet.fastGet(fcsi.order[++doc])) {}
@ -161,11 +151,6 @@ public class FieldCacheTermsFilter extends Filter {
return doc;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) {
try {
doc = target;

View File

@ -49,20 +49,10 @@ public abstract class FilteredDocIdSetIterator extends DocIdSetIterator {
*/
abstract protected boolean match(int doc) throws IOException;
/** @deprecated use {@link #docID()} instead. */
public final int doc() {
return doc;
}
public int docID() {
return doc;
}
/** @deprecated use {@link #nextDoc()} instead. */
public final boolean next() throws IOException{
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
while ((doc = _innerIter.nextDoc()) != NO_MORE_DOCS) {
if (match(doc)) {
@ -72,11 +62,6 @@ public abstract class FilteredDocIdSetIterator extends DocIdSetIterator {
return doc;
}
/** @deprecated use {@link #advance(int)} instead. */
public final boolean skipTo(int n) throws IOException{
return advance(n) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
doc = _innerIter.advance(target);
if (doc != NO_MORE_DOCS) {

View File

@ -130,11 +130,6 @@ extends Query {
return scorerDoc;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
int scorerDoc, disiDoc;
return doc = (disiDoc = docIdSetIterator.nextDoc()) != NO_MORE_DOCS
@ -142,15 +137,8 @@ extends Query {
&& advanceToCommon(scorerDoc, disiDoc) != NO_MORE_DOCS ? scorer.docID() : NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return scorer.doc(); }
public int docID() { return doc; }
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int i) throws IOException {
return advance(i) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
int disiDoc, scorerDoc;
return doc = (disiDoc = docIdSetIterator.advance(target)) != NO_MORE_DOCS

View File

@ -61,20 +61,10 @@ public class MatchAllDocsQuery extends Query {
return null; // not called... see MatchAllDocsWeight.explain()
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return termDocs.doc();
}
public int docID() {
return doc;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return doc = termDocs.next() ? termDocs.doc() : NO_MORE_DOCS;
}
@ -83,11 +73,6 @@ public class MatchAllDocsQuery extends Query {
return norms == null ? score : score * Similarity.decodeNorm(norms[docID()]);
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
}

View File

@ -69,16 +69,8 @@ abstract class PhraseScorer extends Scorer {
first.doc = -1;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return first.doc; }
public int docID() { return first.doc; }
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (firstTime) {
init();
@ -118,11 +110,6 @@ abstract class PhraseScorer extends Scorer {
return norms == null ? raw : raw * Similarity.decodeNorm(norms[first.doc]); // normalize
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
firstTime = false;
for (PhrasePositions pp = first; more && pp != null; pp = pp.next) {

View File

@ -41,11 +41,6 @@ class ReqExclScorer extends Scorer {
this.exclDisi = exclDisi;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (reqScorer == null) {
return doc;
@ -93,11 +88,6 @@ class ReqExclScorer extends Scorer {
return NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return reqScorer.doc(); // reqScorer may be null when next() or skipTo() already return false
}
public int docID() {
return doc;
}
@ -110,11 +100,6 @@ class ReqExclScorer extends Scorer {
return reqScorer.score(); // reqScorer may be null when next() or skipTo() already return false
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
if (reqScorer == null) {
return doc = NO_MORE_DOCS;

View File

@ -43,29 +43,14 @@ class ReqOptSumScorer extends Scorer {
this.optScorer = optScorer;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return reqScorer.next();
}
public int nextDoc() throws IOException {
return reqScorer.nextDoc();
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return reqScorer.skipTo(target);
}
public int advance(int target) throws IOException {
return reqScorer.advance(target);
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return reqScorer.doc();
}
public int docID() {
return reqScorer.docID();
}

View File

@ -64,20 +64,10 @@ public class ScoreCachingWrappingScorer extends Scorer {
return curScore;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return scorer.doc();
}
public int docID() {
return scorer.docID();
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return scorer.next();
}
public int nextDoc() throws IOException {
return scorer.nextDoc();
}
@ -86,11 +76,6 @@ public class ScoreCachingWrappingScorer extends Scorer {
scorer.score(collector);
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return scorer.skipTo(target);
}
public int advance(int target) throws IOException {
return scorer.advance(target);
}

View File

@ -100,23 +100,8 @@ final class TermScorer extends Scorer {
return true;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return doc; }
public int docID() { return doc; }
/**
* Advances to the next document matching the query. <br>
* The iterator over the matching documents is buffered using
* {@link TermDocs#read(int[],int[])}.
*
* @return true iff there is another document matching the query.
* @deprecated use {@link #nextDoc()} instead.
*/
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
/**
* Advances to the next document matching the query. <br>
* The iterator over the matching documents is buffered using
@ -150,20 +135,6 @@ final class TermScorer extends Scorer {
return norms == null ? raw : raw * SIM_NORM_DECODER[norms[doc] & 0xFF]; // normalize for field
}
/**
* Skips to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>
* The implementation uses {@link TermDocs#skipTo(int)}.
*
* @param target
* The target document number.
* @return true iff there is such a match.
* @deprecated use {@link #advance(int)} instead.
*/
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
/**
* Advances to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>

View File

@ -401,11 +401,6 @@ public class CustomScoreQuery extends Query {
this.vScores = new float[valSrcScorers.length];
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
int doc = subQueryScorer.nextDoc();
if (doc != NO_MORE_DOCS) {
@ -416,11 +411,6 @@ public class CustomScoreQuery extends Query {
return doc;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return subQueryScorer.doc();
}
public int docID() {
return subQueryScorer.docID();
}
@ -433,11 +423,6 @@ public class CustomScoreQuery extends Query {
return qWeight * customScore(subQueryScorer.docID(), subQueryScorer.score(), vScores);
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
int doc = subQueryScorer.advance(target);
if (doc != NO_MORE_DOCS) {

View File

@ -126,38 +126,23 @@ public class ValueSourceQuery extends Query {
termDocs = reader.termDocs(null);
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return termDocs.next();
}
public int nextDoc() throws IOException {
return doc = termDocs.next() ? termDocs.doc() : NO_MORE_DOCS;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return termDocs.doc();
}
public int docID() {
return doc;
}
public int advance(int target) throws IOException {
return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
}
/*(non-Javadoc) @see org.apache.lucene.search.Scorer#score() */
public float score() throws IOException {
return qWeight * vals.floatVal(termDocs.doc());
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return termDocs.skipTo(target);
}
public int advance(int target) throws IOException {
return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
}
/*(non-Javadoc) @see org.apache.lucene.search.Scorer#explain(int) */
public Explanation explain(int doc) throws IOException {
float sc = qWeight * vals.floatVal(doc);

View File

@ -55,11 +55,6 @@ public class SpanScorer extends Scorer {
}
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
if (!setFreqCurrentDoc()) {
doc = NO_MORE_DOCS;
@ -67,11 +62,6 @@ public class SpanScorer extends Scorer {
return doc;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
if (!more) {
return doc = NO_MORE_DOCS;
@ -99,9 +89,6 @@ public class SpanScorer extends Scorer {
return true;
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return doc; }
public int docID() { return doc; }
public float score() throws IOException {

View File

@ -159,25 +159,10 @@ final class JustCompileSearch {
static final class JustCompileDocIdSetIterator extends DocIdSetIterator {
/** @deprecated delete in 3.0 */
public int doc() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public int docID() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
/** @deprecated delete in 3.0 */
public boolean next() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
/** @deprecated delete in 3.0 */
public boolean skipTo(int target) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public int nextDoc() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@ -339,25 +324,10 @@ final class JustCompileSearch {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
/** @deprecated delete in 3.0 */
public int doc() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public int docID() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
/** @deprecated delete in 3.0. */
public boolean next() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
/** @deprecated delete in 3.0. */
public boolean skipTo(int target) throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
public int nextDoc() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}

View File

@ -82,21 +82,12 @@ public class TestBooleanScorer extends LuceneTestCase
private int doc = -1;
public Explanation explain(int doc) throws IOException { return null; }
public float score() throws IOException { return 0; }
/** @deprecated delete in 3.0. */
public int doc() { return 3000; }
public int docID() { return doc; }
/** @deprecated delete in 3.0 */
public boolean next() throws IOException { return nextDoc() != NO_MORE_DOCS; }
public int nextDoc() throws IOException {
return doc = doc == -1 ? 3000 : NO_MORE_DOCS;
}
/** @deprecated delete in 3.0 */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
return doc = target <= 3000 ? 3000 : NO_MORE_DOCS;
}

View File

@ -48,31 +48,16 @@ public class TestDocIdSet extends LuceneTestCase {
int docid = -1;
/** @deprecated use {@link #docID()} instead. */
public int doc() {
return docid;
}
public int docID() {
return docid;
}
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
//@Override
public int nextDoc() throws IOException {
docid++;
return docid < maxdoc ? docid : (docid = NO_MORE_DOCS);
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
//@Override
public int advance(int target) throws IOException {
while (nextDoc() < target) {}

View File

@ -36,25 +36,12 @@ public class TestPositiveScoresOnlyCollector extends LuceneTestCase {
return idx == scores.length ? Float.NaN : scores[idx];
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return idx; }
public int docID() { return idx; }
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return ++idx != scores.length ? idx : NO_MORE_DOCS;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
idx = target;
return idx < scores.length ? idx : NO_MORE_DOCS;

View File

@ -42,25 +42,12 @@ public class TestScoreCachingWrappingScorer extends LuceneTestCase {
return idx == scores.length ? Float.NaN : scores[idx++];
}
/** @deprecated use {@link #docID()} instead. */
public int doc() { return doc; }
public int docID() { return doc; }
/** @deprecated use {@link #nextDoc()} instead. */
public boolean next() throws IOException {
return nextDoc() != NO_MORE_DOCS;
}
public int nextDoc() throws IOException {
return ++doc < scores.length ? doc : NO_MORE_DOCS;
}
/** @deprecated use {@link #advance(int)} instead. */
public boolean skipTo(int target) throws IOException {
return advance(target) != NO_MORE_DOCS;
}
public int advance(int target) throws IOException {
doc = target;
return doc < scores.length ? doc : NO_MORE_DOCS;