KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > util > UtilCompatibleJdk15


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/util/UtilCompatibleJdk15.java#1 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2007-2007 Julian Hyde
7 // All Rights Reserved.
8 // You must accept the terms of that agreement to use this software.
9 */

10 package mondrian.util;
11
12 import java.util.Set JavaDoc;
13 import java.util.EnumSet JavaDoc;
14
15 /**
16  * Implementation of {@link UtilCompatible} which runs in
17  * JDK 1.5.
18  *
19  * <p>Prior to JDK 1.5, this class should never be loaded. Applications should
20  * instantiate this class via {@link Class#forName(String)} or better, use
21  * methods in {@link mondrian.olap.Util}, and not instantiate it at all.
22  *
23  * @author jhyde
24  * @version $Id: //open/mondrian/src/main/mondrian/util/UtilCompatibleJdk15.java#1 $
25  * @since Feb 5, 2007
26  */

27 public class UtilCompatibleJdk15 implements UtilCompatible {
28     public <E extends Enum JavaDoc<E>> Set JavaDoc<E> enumSetOf(E first, E... rest) {
29         return EnumSet.of(first, rest);
30     }
31
32     public <E extends Enum JavaDoc<E>> Set JavaDoc<E> enumSetNoneOf(Class JavaDoc<E> elementType) {
33         return EnumSet.noneOf(elementType);
34     }
35
36     public <E extends Enum JavaDoc<E>> Set JavaDoc<E> enumSetAllOf(Class JavaDoc<E> elementType) {
37         return EnumSet.allOf(elementType);
38     }
39 }
40
41 // End UtilCompatibleJdk15.java
42
Popular Tags