1 public class HashEntry {
9 * hashCode that combines two strings using xor.
10 * @return a hash code value on the entire object.
12 public int hashCode() {
14 // this will not work well if some of the strings are equal.
15 result = engine.hashCode();
16 result ^= signature.hashCode();
17 //result ^= stats.hashCode();
18 //System.out.println("HashEntry: hashCode= " + result);
22 public void setengine(GString engine) {
26 public void setstats(HashStat stats) {
30 public void setsig(GString signature) {
31 this.signature=signature;
34 public GString getEngine() {
38 public GString getSignature() {
42 public HashStat getStats() {
46 public boolean equals(Object o) {
47 if(o.getType()!=getType())
49 HashEntry he = (HashEntry)o;
50 if(!(he.getEngine().equals(engine)))
52 if(!(he.getSignature().equals(signature)))
54 //if(!(he.getStats().equals(stats)))
59 public int askForSpam() {
60 int[] users = stats.getUsers();
62 for(int i=0; i<users.length; i++) {
63 int userid = users[i];
64 spamConfidence += stats.userstat[userid].getChecked();
66 return spamConfidence;