KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > generator > java > ast > lib > ModifierKindImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Christophe Demarey.
23 Contributor(s): ________________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.generator.java.ast.lib;
28
29 /**
30  * Enumeration for modifiers.
31  *
32  * @author <a HREF="mailto:Christophe.Demarey * @lifl .fr">Christophe Demarey</a>
33  *
34  * @version 0.1
35  */

36 public final class ModifierKindImpl
37 {
38     // ==================================================================
39
//
40
// Class Internal State.
41
//
42
// ==================================================================
43

44     /**
45      * Enum member mk_public value
46      */

47     public static final int mk_public_ = 0;
48
49     /**
50      * Enum member mk_public
51      */

52     public static final ModifierKindImpl mk_public = new ModifierKindImpl(mk_public_);
53
54     /**
55      * Enum member mk_protected value
56      */

57     public static final int mk_protected_ = 1;
58
59     /**
60      * Enum member mk_protected
61      */

62     public static final ModifierKindImpl mk_protected = new ModifierKindImpl(mk_protected_);
63
64     /**
65      * Enum member mk_private value
66      */

67     public static final int mk_private_ = 2;
68
69     /**
70      * Enum member mk_private
71      */

72     public static final ModifierKindImpl mk_private = new ModifierKindImpl(mk_private_);
73
74
75     // ==================================================================
76
//
77
// Internal State.
78
//
79
// ==================================================================
80

81     /**
82      * Internal member value
83      */

84     private final int ModifierKind_value_;
85
86     // ==================================================================
87
//
88
// Constructor.
89
//
90
// ==================================================================
91

92     /**
93      * Private constructor
94      * @param the enum value for this new member
95      */

96     private ModifierKindImpl( int value )
97     {
98         ModifierKind_value_ = value;
99     }
100
101     // ==================================================================
102
//
103
// Public methods.
104
//
105
// ==================================================================
106

107     /**
108      * Return the internal member value
109      * @return the member value
110      */

111     public int value()
112     {
113         return ModifierKind_value_;
114     }
115
116     /**
117      * Return a enum member from its value
118      * @param an enum value
119      * @return an enum member
120      */

121     public static ModifierKindImpl from_int(int value)
122     {
123         switch (value)
124         {
125         case 0 :
126             return mk_public;
127         case 1 :
128             return mk_protected;
129         case 2 :
130             return mk_private;
131         }
132         return null;
133     }
134
135     /**
136      * Return a string representation
137      * @return a string representation of the enumeration
138      */

139     public java.lang.String JavaDoc toString()
140     {
141         switch (ModifierKind_value_)
142         {
143         case 0 :
144             return "public";
145         case 1 :
146             return "protected";
147         case 2 :
148             return "private";
149         }
150         return "";
151     }
152
153 }
154
Popular Tags