KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > session > OSType


1 /*
2  * $Id: OSType.java,v 1.2 2005/05/20 09:15:32 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.session;
15
16 /**
17  * Typesafe enumeration class of operating systems on browsers client side.
18  */

19 public class OSType {
20     /**
21      * Operating system information could not be found.
22      */

23     public static final OSType UNKNOWN = new OSType(0, "Unknown OS");
24
25     /**
26      * Browser os is of type Unix.
27      */

28     public static final OSType UNIX = new OSType(1, "Unix");
29
30     /**
31      * Browser os is of type Windows.
32      */

33     public static final OSType WINDOWS = new OSType(2, "Windows");
34
35     /**
36      * Browser os is of type MacOS
37      */

38     public static final OSType MACOS = new OSType(3, "Mac OS");
39
40     /**
41      * Browser os is of type IBM-os. f.e. os/2
42      */

43     public static final OSType IBMOS = new OSType(4, "IBM OS/2");
44
45     private int id;
46     private String JavaDoc name;
47
48     /** Typesafe enum constructor. */
49     private OSType(int id, String JavaDoc name) {
50         this.id = id;
51         this.name = name;
52     }
53
54     /**
55      * @return A unique id for this operating system.
56      */

57     public int getId() {
58         return id;
59     }
60
61     /**
62      * @return Clear-Text browserName of this operating system
63      */

64     public String JavaDoc getName() {
65         return name;
66     }
67
68     public String JavaDoc toString() {
69         return getName();
70     }
71 }
72
Popular Tags