plasmaCrawlLURL$kiter cleanup

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3050 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 18 years ago
parent 773ba1e91a
commit fbe1ee402b

@ -370,33 +370,33 @@ public final class plasmaCrawlLURL {
// enumerates entry elements // enumerates entry elements
return new kiter(up, rotating, firstHash); return new kiter(up, rotating, firstHash);
} }
public class kiter implements Iterator { public class kiter implements Iterator {
// enumerates entry elements // enumerates entry elements
Iterator i; private Iterator iter;
boolean error = false; private boolean error;
public kiter(boolean up, boolean rotating, String firstHash) throws IOException { public kiter(boolean up, boolean rotating, String firstHash) throws IOException {
i = urlIndexFile.rows(up, rotating, (firstHash == null) ? null : firstHash.getBytes()); this.iter = plasmaCrawlLURL.this.urlIndexFile.rows(up, rotating, (firstHash == null) ? null : firstHash.getBytes());
error = false; this.error = false;
} }
public boolean hasNext() { public final boolean hasNext() {
if (error) return false; if (this.error) { return false; }
return i.hasNext(); return this.iter.hasNext();
} }
public Object next() throws RuntimeException { public final Object next() {
kelondroRow.Entry e = null; kelondroRow.Entry e = null;
if (i.hasNext()) { e = (kelondroRow.Entry) i.next(); } if (this.iter == null) { return null; }
if (this.iter.hasNext()) { e = (kelondroRow.Entry) this.iter.next(); }
if (e == null) { return null; } if (e == null) { return null; }
return new indexURLEntryNew(e, null); return new indexURLEntryNew(e, null);
} }
public void remove() { public final void remove() {
i.remove(); this.iter.remove();
} }
} }
/** /**

Loading…
Cancel
Save