1 2 3 4 package net.nutch.linkdb; 5 6 import java.io.*; 7 import java.util.*; 8 import net.nutch.io.*; 9 10 17 public class LinkAnalysisEntry extends VersionedWritable { 18 private final static byte VERSION = 1; 19 20 float score; 21 22 24 public LinkAnalysisEntry() { 25 score = 0.0f; 26 } 27 28 public byte getVersion() { return VERSION; } 29 30 32 public void setScore(float score) { 33 this.score = score; 34 } 35 36 38 public void readFields(DataInput in) throws IOException { 39 super.readFields(in); 40 41 score = in.readFloat(); 42 } 43 44 46 public void write(DataOutput out) throws IOException { 47 super.write(out); 48 49 out.writeFloat(score); 50 } 51 52 54 public static LinkAnalysisEntry read(DataInput in) throws IOException { 55 LinkAnalysisEntry lae = new LinkAnalysisEntry(); 56 lae.readFields(in); 57 return lae; 58 } 59 60 public float getScore() { 64 return score; 65 } 66 67 69 public boolean equals(Object o) { 70 LinkAnalysisEntry other = (LinkAnalysisEntry) o; 71 72 if (score == other.score) { 73 return true; 74 } 75 return false; 76 } 77 78 } 79 | Popular Tags |