2014-10-27 14:41:22 +01:00
|
|
|
package org.gcube.portlets.user.topics.shared;
|
|
|
|
|
2016-09-30 14:20:19 +02:00
|
|
|
/**
|
|
|
|
* Bean class for hashtag and its occurrence number
|
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
2014-10-27 14:41:22 +01:00
|
|
|
public class HashTagAndOccurrence implements Comparable<HashTagAndOccurrence>{
|
|
|
|
private String hashtag;
|
|
|
|
private Integer occurrence;
|
2016-05-10 12:03:57 +02:00
|
|
|
private double weight;
|
2014-10-27 14:41:22 +01:00
|
|
|
public HashTagAndOccurrence(String hashtag, Integer occurrence) {
|
|
|
|
super();
|
|
|
|
this.hashtag = hashtag;
|
|
|
|
this.occurrence = occurrence;
|
|
|
|
}
|
2016-05-10 12:03:57 +02:00
|
|
|
public HashTagAndOccurrence(String hashtag, Integer occurrence, double weight) {
|
|
|
|
super();
|
|
|
|
this.hashtag = hashtag;
|
|
|
|
this.occurrence = occurrence;
|
|
|
|
this.weight = weight;
|
|
|
|
}
|
2014-10-27 14:41:22 +01:00
|
|
|
public String getHashtag() {
|
|
|
|
return hashtag;
|
|
|
|
}
|
|
|
|
public void setHashtag(String hashtag) {
|
|
|
|
this.hashtag = hashtag;
|
|
|
|
}
|
|
|
|
public Integer getOccurrence() {
|
|
|
|
return occurrence;
|
|
|
|
}
|
|
|
|
public void setOccurrence(Integer occurrence) {
|
|
|
|
this.occurrence = occurrence;
|
|
|
|
}
|
2016-05-10 12:03:57 +02:00
|
|
|
public double getWeight() {
|
|
|
|
return weight;
|
|
|
|
}
|
|
|
|
public void setWeight(double weight) {
|
|
|
|
this.weight = weight;
|
|
|
|
}
|
|
|
|
|
2014-10-27 14:41:22 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "HashTagAndOccurrence [hashtag=" + hashtag + ", occurrence="
|
2016-05-10 12:03:57 +02:00
|
|
|
+ occurrence + ", weight=" + weight + "]";
|
2014-10-27 14:41:22 +01:00
|
|
|
}
|
|
|
|
@Override
|
|
|
|
public int compareTo(HashTagAndOccurrence o) {
|
2016-05-10 12:03:57 +02:00
|
|
|
return Double.compare(o.getWeight(), this.weight);
|
2014-10-27 14:41:22 +01:00
|
|
|
}
|
|
|
|
}
|