1 18 package net.sf.drftpd; 19 20 21 25 public class Nukee implements Comparable { 26 private String _username; 27 private long _amount; 28 29 public long getBytes() { 30 return _amount; 31 } 32 33 public int compareTo(Object o) { 34 return compareTo((Nukee) o); 35 } 36 37 public int compareTo(Nukee o) { 38 long thisVal = getBytes(); 39 long anotherVal = o.getBytes(); 40 return ( 41 thisVal < anotherVal ? 1 : (thisVal == anotherVal ? 0 : -1)); 42 } 43 44 public Nukee(String user, long amount) { 45 _username = user; 46 _amount = amount; 47 } 48 49 public String getUsername() { 50 return _username; 51 } 52 53 57 public long getAmount() { 58 return _amount; 59 } 60 61 } 62 | Popular Tags |