KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > module > builders > vwms > PriorityURL


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.module.builders.vwms;
11
12 import java.lang.String JavaDoc;
13 import org.mmbase.util.Sortable;
14
15 /**
16  * Class PriorityURL
17  *
18  * @javadoc
19  * @deprecated not used anywhere
20  * @author vpro
21  * @version $Id: PriorityURL.java,v 1.4 2004/10/08 10:48:07 pierre Exp $
22  */

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 JavaDoc url;
32     private int priority;
33
34     public PriorityURL(String JavaDoc url) {
35         this(url,DEF_PRIORITY);
36     }
37
38     public PriorityURL(String JavaDoc url,int priority) {
39         this.url=url;
40         this.priority=priority;
41     }
42
43     public String JavaDoc 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 JavaDoc toString() {
72         return priority+":"+url;
73     }
74 }
75
Popular Tags