org.apache.lucene.index
abstract public class: AbstractAllTermDocs [javadoc |
source]
java.lang.Object
org.apache.lucene.index.AbstractAllTermDocs
All Implemented Interfaces:
TermDocs
Direct Known Subclasses:
AllTermDocs, InstantiatedAllTermDocs
Base class for enumerating all but deleted docs.
NOTE: this class is meant only to be used internally
by Lucene; it's only public so it can be shared across
packages. This means the API is freely subject to
change, and, the class could be removed entirely, in any
Lucene release. Use directly at your own risk!
Field Summary |
---|
protected int | maxDoc | |
protected int | doc | |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.lucene.index.AbstractAllTermDocs Detail: |
public void close() throws IOException {
}
|
public int doc() {
return doc;
}
|
public int freq() {
return 1;
}
|
abstract public boolean isDeleted(int doc)
|
public boolean next() throws IOException {
return skipTo(doc+1);
}
|
public int read(int[] docs,
int[] freqs) throws IOException {
final int length = docs.length;
int i = 0;
while (i < length && doc < maxDoc) {
if (!isDeleted(doc)) {
docs[i] = doc;
freqs[i] = 1;
++i;
}
doc++;
}
return i;
}
|
public void seek(Term term) throws IOException {
if (term==null) {
doc = -1;
} else {
throw new UnsupportedOperationException();
}
}
|
public void seek(TermEnum termEnum) throws IOException {
throw new UnsupportedOperationException();
}
|
public boolean skipTo(int target) throws IOException {
doc = target;
while (doc < maxDoc) {
if (!isDeleted(doc)) {
return true;
}
doc++;
}
return false;
}
|