|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.schwa.dr.Reader<T>
public final class Reader<T extends Doc>
Reads in docrep documents of type T from the input stream provided in the constructor.
This class implements the Iterator interface, providing an interator for that yields
documents of type T.
| Field Summary | |
|---|---|
static byte |
WIRE_VERSION
docrep wire protocol version that this reader knows how to read. |
| Constructor Summary | |
|---|---|
Reader(ByteArrayInputStream in,
DocSchema docSchema)
Constructs a new docrep reader given the input stream and document schema. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Returns whether or not the reader iterator has any more documents to read in from the input stream. |
Iterator<T> |
iterator()
Returns this same object as an Iterator to comply with the Iterable interface. |
T |
next()
Reads the next document from the input stream and returns it. |
void |
remove()
This optional method from Iterator is unsupported. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte WIRE_VERSION
| Constructor Detail |
|---|
public Reader(ByteArrayInputStream in,
DocSchema docSchema)
in - The input stream to read from. This needs to be an input stream which has full
InputStream.mark(int) support to implement lazy loading correctly. To
ensure this is the case, the input stream must currently be a
ByteArrayInputStream.docSchema - The DocSchema instance to use for reading. Unlike the other docrep
APIs, this argument cannot be optional as you cannot be the .class attribute
of a generic type due to type erasure.| Method Detail |
|---|
public Iterator<T> iterator()
Iterator to comply with the Iterable interface.
iterator in interface Iterable<T extends Doc>public boolean hasNext()
hasNext in interface Iterator<T extends Doc>public T next()
next in interface Iterator<T extends Doc>public void remove()
Iterator is unsupported.
remove in interface Iterator<T extends Doc>UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||