Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/eireneh/util/UserLevel.java


1   
2   package com.eireneh.util;
3   
4   /**
5   * A UserLevel keeps a track of how advanced the user is.
6   * It may not be a graphical component, but many graphical components
7   * depend on it, and it doesn't seem to be a 'util'.
8   * <p>We should consider having a addUserLevelListener interface for
9   * people that want to know about UserLevel changes. Hmmmm.
10  * 
11  * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
12  * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
13  * Distribution Licence:<br />
14  * Project B is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General Public License,
16  * version 2 as published by the Free Software Foundation.<br />
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.<br />
21  * The License is available on the internet
22  * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
23  * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24  * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
25  * The copyright to this program is held by it's authors.
26  * </font></td></tr></table>
27  * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
28  * @see docs.Licence
29  * @author Joe Walker
30  */
31  public class UserLevel
32  {
33      /**
34      * Ensure that we can't be instansiated
35      */
36      private UserLevel()
37      {
38      }
39  
40      /**
41      * Accessor for the user level
42      * @return the current users name
43      */
44      public static int getUserLevel()
45      {
46          return level;
47      }
48  
49      /**
50      * Accessor for the user level
51      * @param level The new user level
52      */
53      public static void setUserLevel(int level)
54      {
55          UserLevel.level = level;
56      }
57  
58      /**
59      * Accessor for the user level
60      * @param level The new user level
61      */
62      public static String[] getLevels()
63      {
64          return names;
65      }
66  
67      /** User level - Beginner */
68      public static final int LEVEL_BEGINNER = 0;
69  
70      /** User level - Intermediate */
71      public static final int LEVEL_INTERMEDIATE = 1;
72  
73      /** User level - Advanced */
74      public static final int LEVEL_ADVANCED = 2;
75  
76      /** The level names */
77      private static final String[] names = { "Beginner", "Intermediate", "Advanced", };
78  
79      /** The User level */
80      private static int level = 0;
81  }