package com.sagacloud.pojos; /* * Author: Jxing * Create Time: 2018/11/13 */ import com.alibaba.fastjson.JSONObject; public class RecommendObject implements Comparable { private double similarity ; private JSONObject obj; public RecommendObject(double similarity, JSONObject obj){ this.similarity = similarity; this.obj = obj; } @Override public int compareTo(Object o) { RecommendObject current = (RecommendObject)o; if(current.similarity > this.similarity){ return 1; }else if(current.similarity == this.similarity){ return 0; } return -1; } public double getSimilarity() { return similarity; } public void setSimilarity(double similarity) { this.similarity = similarity; } public JSONObject getObj() { return obj; } public void setObj(JSONObject obj) { this.obj = obj; } }