8a8390e8ed45cd440f3d97866f49764e824e5aef
[jSite.git] / src / de / todesbaum / util / freenet / fcp2 / PriorityClass.java
1 /*
2  * todesbaum-lib -
3  * Copyright (C) 2006 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 package de.todesbaum.util.freenet.fcp2;
21
22 /**
23  * The possible priority classes. Possible values are, in order of descending
24  * priority: <code>maximum</code> (anything more important than fproxy),
25  * <code>interactive</code> (fproxy), <code>semi-interactive</code> (fproxy
26  * immediate mode large file downloads, not to disk), <code>updatable</code>
27  * (updatable site checks), <code>bulk</code> (large file downloads to disk),
28  * <code>prefetch</code>, <code>minimum</code>.
29  *
30  * @author David Roden &lt;droden@gmail.com&gt;
31  * @version $Id$
32  */
33 public final class PriorityClass {
34
35         /** Denotes <code>maximum</code> priority class. */
36         public static final PriorityClass MAXIMUM = new PriorityClass("maximum", 0);
37
38         /** Denotes <code>interactive</code> priority class. */
39         public static final PriorityClass INTERACTIVE = new PriorityClass("interactive", 1);
40
41         /** Denotes <code>semi-interactive</code> priority class. */
42         public static final PriorityClass SEMI_INTERACTIVE = new PriorityClass("semiInteractive", 2);
43
44         /** Denotes <code>updatable</code> priority class. */
45         public static final PriorityClass UPDATABLE = new PriorityClass("updatable", 3);
46
47         /** Denotes <code>bulk</code> priority class. */
48         public static final PriorityClass BULK = new PriorityClass("bulk", 4);
49
50         /** Denotes <code>prefetch</code> priority class. */
51         public static final PriorityClass PREFETCH = new PriorityClass("prefetch", 5);
52
53         /** Denotes <code>minimum</code> priority class. */
54         public static final PriorityClass MINIMUM = new PriorityClass("minimum", 6);
55
56         /** The name of the priority class. */
57         private String name;
58
59         /** The value of the priority class. */
60         private int value;
61
62         /**
63          * Creates a new priority class with the specified name and value.
64          *
65          * @param name
66          *            The name of the priority class
67          * @param value
68          *            The value of the priority class
69          */
70         private PriorityClass(String name, int value) {
71                 this.name = name;
72                 this.value = value;
73         }
74
75         /**
76          * Returns the name of this priority class.
77          *
78          * @return The name of this priority class
79          */
80         public String getName() {
81                 return name;
82         }
83
84         /**
85          * Returns the value of this priority class.
86          *
87          * @return The value of this priority class
88          */
89         public int getValue() {
90                 return value;
91         }
92
93 }