null
if there are no other documents.
Warning: the specification of this method has significantly changed as of MG4J 1.2. The special return value -1 is used to mark the end of iteration (a {@link NoSuchElementException}would have been thrown before in that case, so ho harm should be caused by this change). The reason for this change is providing fully lazy iteration over documents. Fully lazy iteration does not provide an hasNext()
method—you have to actually ask for the next element and check the return value. Fully lazy iteration is much lighter on method calls (half) and in most (if not all) MG4J classes leads to a much simpler logic. Moreover, {@link #nextDocument()}can be specified as throwing an {@link IOException}, which avoids the pernicious proliferation of try/catch blocks in very short, low-level methods (it was having a detectable impact on performance).
@return the next document, or -1 if no more documents are available.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|