1 10 package org.mmbase.module.builders.vwms; 11 12 import java.lang.String ; 13 import org.mmbase.util.Sortable; 14 15 23 public class PriorityURL implements Sortable { 24 public static int MIN_PRIORITY=0; 25 public static int LOW_PRIORITY=20; 26 public static int DEF_PRIORITY=80; 27 public static int MEDIUM_PRIORITY=100; 28 public static int HIGH_PRIORITY=150; 29 public static int MAX_PRIORITY=160; 30 31 private String url; 32 private int priority; 33 34 public PriorityURL(String url) { 35 this(url,DEF_PRIORITY); 36 } 37 38 public PriorityURL(String url,int priority) { 39 this.url=url; 40 this.priority=priority; 41 } 42 43 public String getURL() { 44 return url; 45 } 46 47 public int getPriority() { 48 return priority; 49 } 50 51 public void setPriority(int priority) { 52 this.priority=priority; 53 } 54 55 public void increasePriority() { 56 priority++; 57 } 58 59 public void decreasePriority() { 60 priority--; 61 } 62 63 public int hashCode() { 64 return url.hashCode(); 65 } 66 67 public int compare(Sortable otherone) { 68 return ((PriorityURL)otherone).getPriority()-getPriority(); 69 } 70 71 public String toString() { 72 return priority+":"+url; 73 } 74 } 75 | Popular Tags |