/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.queplix.core.modules.services.jxb.types;

//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/

import java.util.Hashtable;

/**
 * Class DelayunitSType.
 *
 * @version $Revision$ $Date$
 */
public class DelayunitSType implements java.io.Serializable {

    //--------------------------/
    //- Class/Member Variables -/
    //--------------------------/

    /**
     * The min type
     */
    public static final int MIN_TYPE = 0;

    /**
     * The instance of the min type
     */
    public static final DelayunitSType MIN = new DelayunitSType(MIN_TYPE,
            "min");

    /**
     * The hour type
     */
    public static final int HOUR_TYPE = 1;

    /**
     * The instance of the hour type
     */
    public static final DelayunitSType HOUR = new DelayunitSType(HOUR_TYPE,
            "hour");

    /**
     * The day type
     */
    public static final int DAY_TYPE = 2;

    /**
     * The instance of the day type
     */
    public static final DelayunitSType DAY = new DelayunitSType(DAY_TYPE,
            "day");

    /**
     * The month type
     */
    public static final int MONTH_TYPE = 3;

    /**
     * The instance of the month type
     */
    public static final DelayunitSType MONTH = new DelayunitSType(MONTH_TYPE,
            "month");

    /**
     * Field _memberTable
     */
    private static java.util.Hashtable _memberTable = init();

    /**
     * Field type
     */
    private int type = -1;

    /**
     * Field stringValue
     */
    private java.lang.String stringValue = null;

    //----------------/
    //- Constructors -/
    //----------------/

    private DelayunitSType(int type, java.lang.String value) {
        super();
        this.type = type;
        this.stringValue = value;
    } //-- com.queplix.core.modules.services.jxb.types.DelayunitSType(int, java.lang.String)

    //-----------/
    //- Methods -/
    //-----------/

    /**
     * Method enumerate
     * <p/>
     * Returns an enumeration of all possible instances of
     * DelayunitSType
     *
     * @return Enumeration
     */
    public static java.util.Enumeration enumerate() {
        return _memberTable.elements();
    } //-- java.util.Enumeration enumerate() 

    /**
     * Method getType
     * <p/>
     * Returns the type of this DelayunitSType
     *
     * @return int
     */
    public int getType() {
        return this.type;
    } //-- int getType() 

    /**
     * Method init
     *
     * @return Hashtable
     */
    private static java.util.Hashtable init() {
        Hashtable members = new Hashtable();
        members.put("min", MIN);
        members.put("hour", HOUR);
        members.put("day", DAY);
        members.put("month", MONTH);
        return members;
    } //-- java.util.Hashtable init() 

    /**
     * Method readResolve
     * <p/>
     * will be called during deserialization to replace the
     * deserialized object with the correct constant instance.
     * <br/>
     *
     * @return Object
     */
    private java.lang.Object readResolve() {
        return valueOf(this.stringValue);
    } //-- java.lang.Object readResolve() 

    /**
     * Method toString
     * <p/>
     * Returns the String representation of this DelayunitSType
     *
     * @return String
     */
    public java.lang.String toString() {
        return this.stringValue;
    } //-- java.lang.String toString() 

    /**
     * Method valueOf
     * <p/>
     * Returns a new DelayunitSType based on the given String
     * value.
     *
     * @param string
     * @return DelayunitSType
     */
    public static com.queplix.core.modules.services.jxb.types.DelayunitSType valueOf(
            java.lang.String string) {
        java.lang.Object obj = null;
        if(string != null) {
            obj = _memberTable.get(string);
        }
        if(obj == null) {
            String err = "'" + string + "' is not a valid DelayunitSType";
            throw new IllegalArgumentException(err);
        }
        return (DelayunitSType) obj;
    } //-- com.queplix.core.modules.services.jxb.types.DelayunitSType valueOf(java.lang.String) 

}
