package com.msj.sync.queue; /** * @author Vincent.M mengshaojie@188.com * @date 2017/3/14 下午7:35 * @copyright ©2017 孟少杰 All Rights Reserved * @desc 实现Comparable的Task,用于UsePriorityBlockingQueue */ public class Task implements Comparable{ private int id; private String name; private String age; @Override public int compareTo(Task task) { //-1 0 1这样顺序排序 return this.id>task.id? 1 : (this.id