3 * Copyright (C) 2006 David Roden
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.
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.
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.
20 package de.todesbaum.util.freenet.fcp2;
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>.
30 * @author David Roden <droden@gmail.com>
33 public final class PriorityClass {
35 /** Denotes <code>maximum</code> priority class. */
36 public static final PriorityClass MAXIMUM = new PriorityClass("maximum", 0);
38 /** Denotes <code>interactive</code> priority class. */
39 public static final PriorityClass INTERACTIVE = new PriorityClass("interactive", 1);
41 /** Denotes <code>semi-interactive</code> priority class. */
42 public static final PriorityClass SEMI_INTERACTIVE = new PriorityClass("semiInteractive", 2);
44 /** Denotes <code>updatable</code> priority class. */
45 public static final PriorityClass UPDATABLE = new PriorityClass("updatable", 3);
47 /** Denotes <code>bulk</code> priority class. */
48 public static final PriorityClass BULK = new PriorityClass("bulk", 4);
50 /** Denotes <code>prefetch</code> priority class. */
51 public static final PriorityClass PREFETCH = new PriorityClass("prefetch", 5);
53 /** Denotes <code>minimum</code> priority class. */
54 public static final PriorityClass MINIMUM = new PriorityClass("minimum", 6);
56 /** The name of the priority class. */
59 /** The value of the priority class. */
63 * Creates a new priority class with the specified name and value.
66 * The name of the priority class
68 * The value of the priority class
70 private PriorityClass(String name, int value) {
76 * Returns the name of this priority class.
78 * @return The name of this priority class
80 public String getName() {
85 * Returns the value of this priority class.
87 * @return The value of this priority class
89 public int getValue() {