KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > lang > enums > Broken3Enum


1 /*
2  * Copyright 2002-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.lang.enums;
17
18 import java.util.Iterator JavaDoc;
19 import java.util.List JavaDoc;
20 import java.util.Map JavaDoc;
21
22 /**
23  * Broken color enumeration.
24  *
25  * @author <a HREF="mailto:scolebourne@joda.org">Stephen Colebourne</a>
26  * @version $Id: Broken3Enum.java 161244 2005-04-14 06:16:36Z ggregory $
27  */

28 public final class Broken3Enum extends Enum JavaDoc {
29     public static final Broken3Enum RED = new Broken3Enum("Red");
30     public static final Broken3Enum GREEN = new Broken3Enum("Green");
31     public static final Broken3Enum BLUE = new Broken3Enum(null); // null not allowed
32

33     private Broken3Enum(String JavaDoc color) {
34         super(color);
35     }
36
37     public static Broken3Enum getEnum(String JavaDoc color) {
38         return (Broken3Enum) getEnum(Broken3Enum.class, color);
39     }
40
41     public static Map JavaDoc getEnumMap() {
42         return getEnumMap(Broken3Enum.class);
43     }
44
45     public static List JavaDoc getEnumList() {
46         return getEnumList(Broken3Enum.class);
47     }
48
49     public static Iterator JavaDoc iterator() {
50         return iterator(Broken3Enum.class);
51     }
52 }
53
Popular Tags