public int compare(Object arg0, Object arg1) { Activation act0 = (Activation)arg0; Activation act1 = (Activation)arg1; // if(act0==null || act1==null) // System.out.println("test"); int ret = act0.getPriority()-act1.getPriority(); if(ret==0) { Long tmp0 = (Long)counts.get(act0); Long tmp1 = (Long)counts.get(act1); long cnt0 = tmp0==null? 0: tmp0.longValue(); long cnt1 = tmp1==null? 0: tmp1.longValue(); // FIFO ret = (int)(cnt1-cnt0); } return ret; } });
public int compare(Object arg0, Object arg1) { Activation act0 = (Activation)arg0; Activation act1 = (Activation)arg1; // if(act0==null || act1==null) // System.out.println("test"); int ret = act0.getPriority()-act1.getPriority(); if(ret==0) { Long tmp0 = (Long)counts.get(act0); Long tmp1 = (Long)counts.get(act1); long cnt0 = tmp0==null? 0: tmp0.longValue(); long cnt1 = tmp1==null? 0: tmp1.longValue(); // FIFO ret = (int)(cnt1-cnt0); } return ret; } });