added missing serialization to remove all warnings

pull/1/head
Michael Peter Christen 13 years ago
parent 1795a7325b
commit 15db703808

@ -20,6 +20,7 @@
package net.yacy.kelondro.data.citation; package net.yacy.kelondro.data.citation;
import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import net.yacy.cora.document.ASCII; import net.yacy.cora.document.ASCII;
@ -33,10 +34,12 @@ import net.yacy.kelondro.order.MicroDate;
import net.yacy.kelondro.rwi.Reference; import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.util.ByteArray; import net.yacy.kelondro.util.ByteArray;
public class CitationReference implements Reference /*, Cloneable*/ { public class CitationReference implements Reference, Serializable {
// this object stores citation attributes to URL references // this object stores citation attributes to URL references
private static final long serialVersionUID=1920200210928897131L;
public static final Row citationRow = new Row(new Column[]{ public static final Row citationRow = new Row(new Column[]{
new Column("h", Column.celltype_string, Column.encoder_bytes, Word.commonHashLength, "urlhash"), new Column("h", Column.celltype_string, Column.encoder_bytes, Word.commonHashLength, "urlhash"),
new Column("m", Column.celltype_cardinal, Column.encoder_b256, 2, "lastModified"), new Column("m", Column.celltype_cardinal, Column.encoder_b256, 2, "lastModified"),

@ -20,11 +20,15 @@
package net.yacy.kelondro.data.citation; package net.yacy.kelondro.data.citation;
import java.io.Serializable;
import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.rwi.ReferenceFactory; import net.yacy.kelondro.rwi.ReferenceFactory;
public class CitationReferenceFactory implements ReferenceFactory<CitationReference> { public class CitationReferenceFactory implements ReferenceFactory<CitationReference>, Serializable {
private static final long serialVersionUID=-1098504892965986149L;
@Override @Override
public CitationReference produceSlow(final Entry e) { public CitationReference produceSlow(final Entry e) {

@ -9,7 +9,7 @@
// $LastChangedBy$ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -26,21 +26,28 @@
package net.yacy.kelondro.data.image; package net.yacy.kelondro.data.image;
import java.io.Serializable;
import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.rwi.ReferenceFactory; import net.yacy.kelondro.rwi.ReferenceFactory;
public class ImageReferenceFactory implements ReferenceFactory<ImageReference> { public class ImageReferenceFactory implements ReferenceFactory<ImageReference>, Serializable {
private static final long serialVersionUID=-2209473508756878863L;
@Override
public ImageReference produceSlow(Entry e) { public ImageReference produceSlow(Entry e) {
return null; //new ImageReferenceRow(e); return null; //new ImageReferenceRow(e);
} }
@Override
public ImageReference produceFast(ImageReference r) { public ImageReference produceFast(ImageReference r) {
if (r instanceof ImageReferenceVars) return r; if (r instanceof ImageReferenceVars) return r;
return new ImageReferenceVars(r); return new ImageReferenceVars(r);
} }
@Override
public Row getRow() { public Row getRow() {
return ImageReferenceRow.urlEntryRow; return ImageReferenceRow.urlEntryRow;
} }

@ -26,6 +26,7 @@
package net.yacy.kelondro.data.image; package net.yacy.kelondro.data.image;
import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -38,9 +39,12 @@ import net.yacy.kelondro.rwi.Reference;
import net.yacy.kelondro.util.ByteArray; import net.yacy.kelondro.util.ByteArray;
public class ImageReferenceVars extends AbstractReference implements ImageReference, Reference, Cloneable { public class ImageReferenceVars extends AbstractReference implements ImageReference, Reference, Cloneable, Serializable {
/** private static final long serialVersionUID=3669156620967277347L;
/**
* object for termination of concurrent blocking queue processing * object for termination of concurrent blocking queue processing
*/ */
public static final ImageReferenceVars poison = new ImageReferenceVars(); public static final ImageReferenceVars poison = new ImageReferenceVars();

@ -9,7 +9,7 @@
// $LastChangedBy$ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -26,21 +26,28 @@
package net.yacy.kelondro.data.navigation; package net.yacy.kelondro.data.navigation;
import java.io.Serializable;
import net.yacy.kelondro.index.Row; import net.yacy.kelondro.index.Row;
import net.yacy.kelondro.index.Row.Entry; import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.rwi.ReferenceFactory; import net.yacy.kelondro.rwi.ReferenceFactory;
public class NavigationReferenceFactory implements ReferenceFactory<NavigationReference> { public class NavigationReferenceFactory implements ReferenceFactory<NavigationReference>, Serializable {
private static final long serialVersionUID=-3440570952034279619L;
@Override
public NavigationReference produceSlow(final Entry e) { public NavigationReference produceSlow(final Entry e) {
return new NavigationReferenceRow(e); return new NavigationReferenceRow(e);
} }
@Override
public NavigationReference produceFast(final NavigationReference r) { public NavigationReference produceFast(final NavigationReference r) {
if (r instanceof NavigationReferenceVars) return r; if (r instanceof NavigationReferenceVars) return r;
return new NavigationReferenceVars(r); return new NavigationReferenceVars(r);
} }
@Override
public Row getRow() { public Row getRow() {
return NavigationReferenceRow.navEntryRow; return NavigationReferenceRow.navEntryRow;
} }

@ -9,7 +9,7 @@
// $LastChangedBy$ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -26,6 +26,7 @@
package net.yacy.kelondro.data.navigation; package net.yacy.kelondro.data.navigation;
import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import net.yacy.cora.document.ASCII; import net.yacy.cora.document.ASCII;
@ -33,12 +34,14 @@ import net.yacy.kelondro.index.Row.Entry;
import net.yacy.kelondro.rwi.AbstractReference; import net.yacy.kelondro.rwi.AbstractReference;
import net.yacy.kelondro.rwi.Reference; import net.yacy.kelondro.rwi.Reference;
public class NavigationReferenceVars extends AbstractReference implements NavigationReference, Reference, Cloneable { public class NavigationReferenceVars extends AbstractReference implements NavigationReference, Reference, Cloneable, Serializable {
private static final long serialVersionUID=2873544331190937594L;
public byte[] termhash, refhash; public byte[] termhash, refhash;
public int hitcount, position; public int hitcount, position;
byte flags; byte flags;
public NavigationReferenceVars( public NavigationReferenceVars(
final byte[] termhash, final byte[] termhash,
final byte[] refhash, final byte[] refhash,
@ -52,7 +55,7 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
this.position = pos; this.position = pos;
this.flags = flags; this.flags = flags;
} }
public NavigationReferenceVars(final NavigationReference e) { public NavigationReferenceVars(final NavigationReference e) {
this.refhash = e.urlhash(); this.refhash = e.urlhash();
this.termhash = e.termHash(); this.termhash = e.termHash();
@ -60,7 +63,7 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
this.position = e.position(0); this.position = e.position(0);
this.flags = e.flags(); this.flags = e.flags();
} }
@Override @Override
public NavigationReferenceVars clone() { public NavigationReferenceVars clone() {
final NavigationReferenceVars c = new NavigationReferenceVars( final NavigationReferenceVars c = new NavigationReferenceVars(
@ -72,7 +75,7 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
); );
return c; return c;
} }
public NavigationReferenceRow toRowEntry() { public NavigationReferenceRow toRowEntry() {
return new NavigationReferenceRow( return new NavigationReferenceRow(
this.termhash, this.termhash,
@ -81,50 +84,58 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
this.position, this.position,
this.flags); this.flags);
} }
@Override
public String toPropertyForm() { public String toPropertyForm() {
return toRowEntry().toPropertyForm(); return toRowEntry().toPropertyForm();
} }
@Override
public Entry toKelondroEntry() { public Entry toKelondroEntry() {
return toRowEntry().toKelondroEntry(); return toRowEntry().toKelondroEntry();
} }
@Override
public String navigationHash() { public String navigationHash() {
return ASCII.String(this.termhash) + ASCII.String(this.refhash); return ASCII.String(this.termhash) + ASCII.String(this.refhash);
} }
@Override
public byte[] urlhash() { public byte[] urlhash() {
return this.refhash; return this.refhash;
} }
@Override
public byte[] termHash() { public byte[] termHash() {
return this.termhash; return this.termhash;
} }
@Override
public int hitcount() { public int hitcount() {
return this.hitcount; return this.hitcount;
} }
@Override
public int position(final int p) { public int position(final int p) {
assert p == 0 : "p = " + p; assert p == 0 : "p = " + p;
return this.position; return this.position;
} }
@Override
public byte flags() { public byte flags() {
return this.flags; return this.flags;
} }
@Override @Override
public String toString() { public String toString() {
return toPropertyForm(); return toPropertyForm();
} }
@Override @Override
public int hashCode() { public int hashCode() {
return this.navigationHash().hashCode(); return this.navigationHash().hashCode();
} }
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
if (this == obj) return true; if (this == obj) return true;
@ -133,24 +144,28 @@ public class NavigationReferenceVars extends AbstractReference implements Navig
NavigationReferenceVars other = (NavigationReferenceVars) obj; NavigationReferenceVars other = (NavigationReferenceVars) obj;
return this.navigationHash().equals(other.navigationHash()); return this.navigationHash().equals(other.navigationHash());
} }
@Override
public boolean isOlder(final Reference other) { public boolean isOlder(final Reference other) {
return false; return false;
} }
// unsupported operations: // unsupported operations:
@Override
public void join(final Reference oe) { public void join(final Reference oe) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public long lastModified() { public long lastModified() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public Collection<Integer> positions() { public Collection<Integer> positions() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} }

@ -9,7 +9,7 @@
// $LastChangedBy$ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -26,6 +26,7 @@
package net.yacy.kelondro.data.word; package net.yacy.kelondro.data.word;
import java.io.Serializable;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -39,13 +40,15 @@ import net.yacy.kelondro.rwi.ReferenceContainer;
import net.yacy.kelondro.rwi.ReferenceFactory; import net.yacy.kelondro.rwi.ReferenceFactory;
import net.yacy.kelondro.util.ByteBuffer; import net.yacy.kelondro.util.ByteBuffer;
public class WordReferenceFactory implements ReferenceFactory<WordReference> { public class WordReferenceFactory implements ReferenceFactory<WordReference>, Serializable {
private static final long serialVersionUID=-7168706947127349876L;
@Override @Override
public WordReference produceSlow(final Entry e) { public WordReference produceSlow(final Entry e) {
return new WordReferenceRow(e); return new WordReferenceRow(e);
} }
@Override @Override
public WordReference produceFast(final WordReference r) { public WordReference produceFast(final WordReference r) {
if (r instanceof WordReferenceVars) return r; if (r instanceof WordReferenceVars) return r;
@ -134,7 +137,7 @@ public class WordReferenceFactory implements ReferenceFactory<WordReference> {
urlsb.append(dom); urlsb.append(dom);
url = urlsb.toString(); url = urlsb.toString();
ci.trim(6); ci.trim(6);
peers = target.get(url); peers = target.get(url);
if (peers == null) { if (peers == null) {
peers = new StringBuilder(24); peers = new StringBuilder(24);

@ -237,7 +237,9 @@ public final class Row implements Serializable {
} }
public class Entry implements Comparable<Entry>, Comparator<Entry>, Cloneable { public class Entry implements Comparable<Entry>, Comparator<Entry>, Cloneable, Serializable {
private static final long serialVersionUID=-2576312347345553495L;
private byte[] rowinstance; private byte[] rowinstance;
private int offset; // the offset where the row starts within rowinstance private int offset; // the offset where the row starts within rowinstance
@ -634,7 +636,10 @@ public final class Row implements Serializable {
} }
public final class EntryIndex extends Entry { public final class EntryIndex extends Entry implements Serializable {
private static final long serialVersionUID=153069052590699231L;
private final int index; private final int index;
public EntryIndex(final byte[] row, final int i) { public EntryIndex(final byte[] row, final int i) {
super(row, false); super(row, false);

@ -7,7 +7,7 @@
// $LastChangedBy$ // $LastChangedBy$
// //
// LICENSE // LICENSE
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or // the Free Software Foundation; either version 2 of the License, or
@ -24,88 +24,91 @@
package net.yacy.kelondro.order; package net.yacy.kelondro.order;
import java.io.Serializable;
public class Bitfield implements Cloneable { public class Bitfield implements Cloneable, Serializable {
// the bitfield implements a binary array. Such arrays may be exported in a base64-String // the bitfield implements a binary array. Such arrays may be exported in a base64-String
private byte[] bb; private static final long serialVersionUID=3605122793792478052L;
private byte[] bb;
public Bitfield() { public Bitfield() {
this(0); this(0);
} }
public Bitfield(final byte[] b) { public Bitfield(final byte[] b) {
if (b == null) this.bb = new byte[0]; else this.bb = b; if (b == null) this.bb = new byte[0]; else this.bb = b;
} }
public Bitfield(final int bytelength) { public Bitfield(final int bytelength) {
this.bb= new byte[bytelength]; this.bb= new byte[bytelength];
for (int i = 0 ; i < bytelength; i++) bb[i] = 0; for (int i = 0 ; i < bytelength; i++) this.bb[i] = 0;
} }
public Bitfield(final int bytelength, final String exported) { public Bitfield(final int bytelength, final String exported) {
// imports a b64-encoded bitfield // imports a b64-encoded bitfield
final byte[] b = Base64Order.enhancedCoder.decode(exported); final byte[] b = Base64Order.enhancedCoder.decode(exported);
if (b.length == bytelength) { if (b.length == bytelength) {
bb = b; this.bb = b;
} else { } else {
bb = new byte[bytelength]; this.bb = new byte[bytelength];
assert (b.length <= bytelength) : "exported = " + exported + " has bytelength = " + b.length + " > " + bytelength; assert (b.length <= bytelength) : "exported = " + exported + " has bytelength = " + b.length + " > " + bytelength;
System.arraycopy(b, 0, bb, 0, Math.min(b.length, bytelength)); System.arraycopy(b, 0, this.bb, 0, Math.min(b.length, bytelength));
} }
} }
@Override @Override
public Bitfield clone() { public Bitfield clone() {
final Bitfield theClone = new Bitfield(new byte[this.bb.length]); final Bitfield theClone = new Bitfield(new byte[this.bb.length]);
System.arraycopy(this.bb, 0, theClone.bb, 0, this.bb.length); System.arraycopy(this.bb, 0, theClone.bb, 0, this.bb.length);
return theClone; return theClone;
} }
public void set(final int pos, final boolean value) { public void set(final int pos, final boolean value) {
assert (pos >= 0); assert (pos >= 0);
final int slot = pos >> 3; // /8 final int slot = pos >> 3; // /8
if (slot >= bb.length) { if (slot >= this.bb.length) {
// extend capacity // extend capacity
byte[] nb = new byte[slot + 1]; byte[] nb = new byte[slot + 1];
System.arraycopy(bb, 0, nb, 0, bb.length); System.arraycopy(this.bb, 0, nb, 0, this.bb.length);
for (int i = bb.length; i < nb.length; i++) nb[i] = 0; for (int i = this.bb.length; i < nb.length; i++) nb[i] = 0;
bb = nb; this.bb = nb;
} }
if (value) { if (value) {
bb[slot] = (byte) (bb[slot] | (1 << (pos % 8))); this.bb[slot] = (byte) (this.bb[slot] | (1 << (pos % 8)));
} else { } else {
bb[slot] = (byte) (bb[slot] & (0xff ^ (1 << (pos % 8)))); this.bb[slot] = (byte) (this.bb[slot] & (0xff ^ (1 << (pos % 8))));
} }
} }
public boolean get(final int pos) { public boolean get(final int pos) {
assert (pos >= 0); assert (pos >= 0);
final int slot = pos >> 3; // /8 final int slot = pos >> 3; // /8
if (slot >= bb.length) return false; if (slot >= this.bb.length) return false;
return (bb[slot] & (1 << (pos % 8))) > 0; return (this.bb[slot] & (1 << (pos % 8))) > 0;
} }
public int length() { public int length() {
return bb.length << 3; return this.bb.length << 3;
} }
public String exportB64() { public String exportB64() {
return Base64Order.enhancedCoder.encode(bb); return Base64Order.enhancedCoder.encode(this.bb);
} }
public byte[] bytes() { public byte[] bytes() {
return bb; return this.bb;
} }
@Override @Override
public String toString() { public String toString() {
final StringBuilder sb = new StringBuilder(length()); final StringBuilder sb = new StringBuilder(length());
for (int i = length() - 1; i >= 0; i--) sb.append((this.get(i)) ? '1' : '0'); for (int i = length() - 1; i >= 0; i--) sb.append((this.get(i)) ? '1' : '0');
return sb.toString(); return sb.toString();
} }
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
if (this == obj) return true; if (this == obj) return true;
@ -116,17 +119,17 @@ public class Bitfield implements Cloneable {
for (int i = 0; i < this.bb.length; i++) if (this.bb[i] != other.bb[i]) return false; for (int i = 0; i < this.bb.length; i++) if (this.bb[i] != other.bb[i]) return false;
return true; return true;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return this.toString().hashCode(); return this.toString().hashCode();
} }
public void and(final Bitfield x) { public void and(final Bitfield x) {
final int c = Math.min(x.length(), this.length()); final int c = Math.min(x.length(), this.length());
for (int i = 0; i < c; i++) set(i, this.get(i) && x.get(i)); for (int i = 0; i < c; i++) set(i, this.get(i) && x.get(i));
} }
public void or(final Bitfield x) { public void or(final Bitfield x) {
final int c = Math.min(x.length(), this.length()); final int c = Math.min(x.length(), this.length());
for (int i = 0; i < c; i++) set(i, this.get(i) || x.get(i)); for (int i = 0; i < c; i++) set(i, this.get(i) || x.get(i));
@ -134,7 +137,7 @@ public class Bitfield implements Cloneable {
for (int i = c; i < x.length(); i++) set(i, x.get(i)); for (int i = c; i < x.length(); i++) set(i, x.get(i));
} }
} }
public void xor(final Bitfield x) { public void xor(final Bitfield x) {
final int c = Math.min(x.length(), this.length()); final int c = Math.min(x.length(), this.length());
for (int i = 0; i < c; i++) set(i, this.get(i) != x.get(i)); for (int i = 0; i < c; i++) set(i, this.get(i) != x.get(i));
@ -142,13 +145,13 @@ public class Bitfield implements Cloneable {
for (int i = c; i < x.length(); i++) set(i, x.get(i)); for (int i = c; i < x.length(); i++) set(i, x.get(i));
} }
} }
public boolean anyOf(final Bitfield x) { public boolean anyOf(final Bitfield x) {
final int c = Math.min(x.length(), this.length()); final int c = Math.min(x.length(), this.length());
for (int i = 0; i < c; i++) if ((x.get(i)) && (this.get(i))) return true; for (int i = 0; i < c; i++) if ((x.get(i)) && (this.get(i))) return true;
return false; return false;
} }
public boolean allOf(final Bitfield x) { public boolean allOf(final Bitfield x) {
final int c = Math.min(x.length(), this.length()); final int c = Math.min(x.length(), this.length());
for (int i = 0; i < c; i++) if ((x.get(i)) && (!(this.get(i)))) return false; for (int i = 0; i < c; i++) if ((x.get(i)) && (!(this.get(i)))) return false;
@ -157,7 +160,7 @@ public class Bitfield implements Cloneable {
} }
return true; return true;
} }
public static void main(final String[] args) { public static void main(final String[] args) {
Bitfield test = new Bitfield(4); Bitfield test = new Bitfield(4);
final int l = test.length(); final int l = test.length();
@ -166,19 +169,19 @@ public class Bitfield implements Cloneable {
for (int i = 0; i < l/2; i++) { for (int i = 0; i < l/2; i++) {
System.out.println(test.exportB64()); System.out.println(test.exportB64());
test.set(i, true); test.set(i, true);
System.out.println(i + ":" + test.toString()); System.out.println(i + ":" + test.toString());
} }
for (int i = l/2; i < l; i++) { for (int i = l/2; i < l; i++) {
System.out.println(test.exportB64()); System.out.println(test.exportB64());
test = new Bitfield(4, test.exportB64()); test = new Bitfield(4, test.exportB64());
test.set(i, true); test.set(i, true);
System.out.println(i + ":" + test.toString()); System.out.println(i + ":" + test.toString());
} }
System.out.println(test.exportB64()); System.out.println(test.exportB64());
for (int i = l - 1; i >= 0; i--) { for (int i = l - 1; i >= 0; i--) {
test.set(i, false); test.set(i, false);
System.out.println(i + ":" + test.toString()); System.out.println(i + ":" + test.toString());
} }
System.out.println("after: " + test.toString()); System.out.println("after: " + test.toString());
} }
} }

@ -54,6 +54,8 @@ import net.yacy.kelondro.order.Base64Order;
*/ */
public class ReferenceContainer<ReferenceType extends Reference> extends RowSet { public class ReferenceContainer<ReferenceType extends Reference> extends RowSet {
private static final long serialVersionUID=-540567425172727979L;
private byte[] termHash; private byte[] termHash;
protected ReferenceFactory<ReferenceType> factory; protected ReferenceFactory<ReferenceType> factory;
public static int maxReferences = 0; // overwrite this to enable automatic index shrinking. 0 means no shrinking public static int maxReferences = 0; // overwrite this to enable automatic index shrinking. 0 means no shrinking
@ -255,16 +257,19 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSet
this.rowEntryIterator = iterator(); this.rowEntryIterator = iterator();
} }
@Override
public boolean hasNext() { public boolean hasNext() {
return this.rowEntryIterator.hasNext(); return this.rowEntryIterator.hasNext();
} }
@Override
public ReferenceType next() { public ReferenceType next() {
final Row.Entry rentry = this.rowEntryIterator.next(); final Row.Entry rentry = this.rowEntryIterator.next();
if (rentry == null) return null; if (rentry == null) return null;
return ReferenceContainer.this.factory.produceSlow(rentry); return ReferenceContainer.this.factory.produceSlow(rentry);
} }
@Override
public void remove() { public void remove() {
this.rowEntryIterator.remove(); this.rowEntryIterator.remove();
} }
@ -562,10 +567,12 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSet
return pivot; return pivot;
} }
@Override
public synchronized String toString() { public synchronized String toString() {
return "C[" + ASCII.String(this.termHash) + "] has " + size() + " entries"; return "C[" + ASCII.String(this.termHash) + "] has " + size() + " entries";
} }
@Override
public int hashCode() { public int hashCode() {
return (int) Base64Order.enhancedCoder.decodeLong(this.termHash, 0, 4); return (int) Base64Order.enhancedCoder.decodeLong(this.termHash, 0, 4);
} }

@ -28,6 +28,7 @@
package net.yacy.peers.graphics; package net.yacy.peers.graphics;
import java.io.File; import java.io.File;
import java.io.Serializable;
import java.text.ParseException; import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -342,8 +343,9 @@ public class WebStructureGraph
hosthashes); hosthashes);
} }
public static class HostReferenceFactory implements ReferenceFactory<HostReference> public static class HostReferenceFactory implements ReferenceFactory<HostReference>, Serializable {
{
private static final long serialVersionUID=7461135579006223155L;
private static final Row hostReferenceRow = new Row( private static final Row hostReferenceRow = new Row(
"String h-6, Cardinal m-4 {b256}, Cardinal c-4 {b256}", "String h-6, Cardinal m-4 {b256}, Cardinal c-4 {b256}",
@ -369,8 +371,9 @@ public class WebStructureGraph
} }
public static class HostReference extends AbstractReference implements Reference public static class HostReference extends AbstractReference implements Reference, Serializable {
{
private static final long serialVersionUID=-9170091435821206765L;
private final Row.Entry entry; private final Row.Entry entry;

Loading…
Cancel
Save