KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > linkdb > LinkAnalysisEntry


1 /* Copyright (c) 2003 The Nutch Organization. All rights reserved. */
2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
3
4 package net.nutch.linkdb;
5
6 import java.io.*;
7 import java.util.*;
8 import net.nutch.io.*;
9
10 /**********************************************
11  * An entry in the LinkAnalysisTool's output. Consists
12  * of a single float for every entry in a table administered
13  * by LinkAnalysisTool.
14  *
15  * @author Mike Cafarella
16  *********************************************/

17 public class LinkAnalysisEntry extends VersionedWritable {
18     private final static byte VERSION = 1;
19
20     float score;
21
22     /**
23      */

24     public LinkAnalysisEntry() {
25         score = 0.0f;
26     }
27
28     public byte getVersion() { return VERSION; }
29
30     /**
31      */

32     public void setScore(float score) {
33         this.score = score;
34     }
35
36     /**
37      */

38     public void readFields(DataInput in) throws IOException {
39         super.readFields(in);
40
41         score = in.readFloat();
42     }
43
44     /**
45      */

46     public void write(DataOutput out) throws IOException {
47         super.write(out);
48
49         out.writeFloat(score);
50     }
51
52     /**
53      */

54     public static LinkAnalysisEntry read(DataInput in) throws IOException {
55         LinkAnalysisEntry lae = new LinkAnalysisEntry();
56         lae.readFields(in);
57         return lae;
58     }
59
60     //
61
// Accessors
62
//
63
public float getScore() {
64         return score;
65     }
66
67     /**
68      */

69     public boolean equals(Object JavaDoc 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