/lib/docs/enum/test/com/plotnix/enum/Flower.java
Java | 81 lines | 11 code | 5 blank | 65 comment | 0 complexity | 20241d82a5b42b0a5b91fb254e5997f0 MD5 | raw file
1/* 2 * $Header$ 3 * $Revision$ 4 * $Date$ 5 * 6 * ==================================================================== 7 * The PLOTNIX Software License, Version 1.0 8 * 9 * 10 * Copyright (c) 2001 The PLOTNIX Software Foundation. All rights 11 * reserved. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 17 * 1. Redistributions of source code must retain the above copyright 18 * notice, this list of conditions and the following disclaimer. 19 * 20 * 2. Redistributions in binary form must reproduce the above copyright 21 * notice, this list of conditions and the following disclaimer in 22 * the documentation and/or other materials provided with the 23 * distribution. 24 * 25 * 3. The end-user documentation included with the redistribution, 26 * if any, must include the following acknowledgment: 27 * "This product includes software developed by the 28 * PLOTNIX, Inc (http://www.plotnix.com/)." 29 * Alternately, this acknowledgment may appear in the software itself, 30 * if and wherever such third-party acknowledgments normally appear. 31 * 32 * 4. The name "PLOTNIX" must not be used to endorse or promote 33 * products derived from this software without prior written 34 * permission. For written permission, please contact dmitri@plotnix.com. 35 * 36 * 5. Products derived from this software may not be called "PLOTNIX", 37 * nor may "PLOTNIX" appear in their name, without prior written 38 * permission of the PLOTNIX, Inc. 39 * 40 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 41 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 42 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 43 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 47 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 48 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 49 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 50 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 * SUCH DAMAGE. 52 * ==================================================================== 53 * 54 * For more information on PLOTNIX, Inc, please see <http://www.plotnix.com/>. 55 */ 56package com.plotnix.enum; 57 58import java.util.*; 59 60/** 61 * Flowers, enums loaded from the Flower.properties file 62 * 63 * @author Dmitri Plotnikov 64 * @version $Revision$ $Date$ 65 */ 66public class Flower extends Enum { 67 68 static { 69 // Load all Enums of this class from Flower.properties 70 loadEnum(Flower.class); 71 } 72 73 public static Flower ROSE = enum("rose"); 74 75 /** 76 * Convenience method that finds a Flower object by its name. 77 */ 78 public static Flower enum(String name){ 79 return (Flower)enum(Flower.class, name); 80 } 81}