001 /* 002 // $Id: //open/mondrian/src/main/mondrian/util/UtilCompatible.java#4 $ 003 // This software is subject to the terms of the Common Public License 004 // Agreement, available at the following URL: 005 // http://www.opensource.org/licenses/cpl.html. 006 // Copyright (C) 2007-2007 Julian Hyde 007 // All Rights Reserved. 008 // You must accept the terms of that agreement to use this software. 009 */ 010 package mondrian.util; 011 012 import java.util.Set; 013 import java.math.BigDecimal; 014 import java.lang.reflect.Method; 015 016 /** 017 * Interface containing methods which are implemented differently in different 018 * versions of the JDK. 019 * 020 * <p>The methods should not be called directly, only via the corresponding 021 * static methods in {@link mondrian.olap.Util}, namely:<ul> 022 * <li>{@link mondrian.olap.Util#enumSetOf(Enum, Enum[])}</li> 023 * <li>{@link mondrian.olap.Util#enumSetNoneOf(Class)}</li> 024 * <li>{@link mondrian.olap.Util#enumSetAllOf(Class)}</li> 025 * <li>{@link mondrian.olap.Util#makeBigDecimalFromDouble(double)}</li> 026 * <li>{@link mondrian.olap.Util#quotePattern(String)}</li> 027 * </ul></p> 028 * 029 * <p>This interface could in principle be extended to allow native 030 * implementations of methods, or to serve as a factory for entire classes 031 * which have different implementations in different environments.</p> 032 * 033 * @author jhyde 034 * @version $Id: //open/mondrian/src/main/mondrian/util/UtilCompatible.java#4 $ 035 * @since Feb 5, 2007 036 */ 037 public interface UtilCompatible { 038 <E extends Enum<E>> Set<E> enumSetOf(E first, E... rest); 039 <E extends Enum<E>> Set<E> enumSetNoneOf(Class<E> elementType); 040 <E extends Enum<E>> Set<E> enumSetAllOf(Class<E> elementType); 041 042 BigDecimal makeBigDecimalFromDouble(double d); 043 044 String quotePattern(String s); 045 046 <T> T getAnnotation( 047 Method method, String annotationClassName, T defaultValue); 048 } 049 050 // End UtilCompatible.java