/*
 * 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 StatusSType.
 *
 * @version $Revision$ $Date$
 */
public class StatusSType implements java.io.Serializable {

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

    /**
     * The new type
     */
    public static final int NEW_TYPE = 0;

    /**
     * The instance of the new type
     */
    public static final StatusSType NEW = new StatusSType(NEW_TYPE, "new");

    /**
     * The ready type
     */
    public static final int READY_TYPE = 1;

    /**
     * The instance of the ready type
     */
    public static final StatusSType READY = new StatusSType(READY_TYPE,
            "ready");

    /**
     * The run type
     */
    public static final int RUN_TYPE = 2;

    /**
     * The instance of the run type
     */
    public static final StatusSType RUN = new StatusSType(RUN_TYPE, "run");

    /**
     * The waited type
     */
    public static final int WAITED_TYPE = 3;

    /**
     * The instance of the waited type
     */
    public static final StatusSType WAITED = new StatusSType(WAITED_TYPE,
            "waited");

    /**
     * The completed type
     */
    public static final int COMPLETED_TYPE = 4;

    /**
     * The instance of the completed type
     */
    public static final StatusSType COMPLETED = new StatusSType(COMPLETED_TYPE,
            "completed");

    /**
     * The interrupted type
     */
    public static final int INTERRUPTED_TYPE = 5;

    /**
     * The instance of the interrupted type
     */
    public static final StatusSType INTERRUPTED = new StatusSType(
            INTERRUPTED_TYPE, "interrupted");

    /**
     * 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 StatusSType(int type, java.lang.String value) {
        super();
        this.type = type;
        this.stringValue = value;
    } //-- com.queplix.core.modules.services.jxb.types.StatusSType(int, java.lang.String)

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

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

    /**
     * Method getType
     * <p/>
     * Returns the type of this StatusSType
     *
     * @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("new", NEW);
        members.put("ready", READY);
        members.put("run", RUN);
        members.put("waited", WAITED);
        members.put("completed", COMPLETED);
        members.put("interrupted", INTERRUPTED);
        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 StatusSType
     *
     * @return String
     */
    public java.lang.String toString() {
        return this.stringValue;
    } //-- java.lang.String toString() 

    /**
     * Method valueOf
     * <p/>
     * Returns a new StatusSType based on the given String value.
     *
     * @param string
     * @return StatusSType
     */
    public static com.queplix.core.modules.services.jxb.types.StatusSType 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 StatusSType";
            throw new IllegalArgumentException(err);
        }
        return (StatusSType) obj;
    } //-- com.queplix.core.modules.services.jxb.types.StatusSType valueOf(java.lang.String) 

}
