1 19 20 package org.lucane.applications.maininterface; 21 22 import org.lucane.client.Plugin; 23 24 class PluginUse implements Comparable 25 { 26 private Plugin plugin; 27 private int use; 28 29 public PluginUse(Plugin plugin, String use) 30 { 31 this.plugin = plugin; 32 if(use != null) 33 this.use = Integer.parseInt(use); 34 else 35 this.use = 0; 36 } 37 38 public int compareTo(Object other) 39 { 40 if(other instanceof PluginUse) 41 return this.use - ((PluginUse)other).use; 42 43 throw new IllegalArgumentException ("other must be an instance of PluginUse"); 44 } 45 46 public Plugin getPlugin() 47 { 48 return this.plugin; 49 } 50 } | Popular Tags |