// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1.2_01, build R40)
// Generated source version: 1.1.2

package org.jboss.test.ws.jaxrpc.encoded.parametermode;


import java.util.HashMap;
import java.util.Map;

public class EnumDouble {
    private double value;
    private static Map valueMap = new HashMap();
    public static final double _value1 = (double)-1.0000000000000;
    public static final double _value2 = (double)3.0000000000000;
    
    public static final EnumDouble value1 = new EnumDouble(_value1);
    public static final EnumDouble value2 = new EnumDouble(_value2);
    
    protected EnumDouble(double value) {
        this.value = value;
        valueMap.put(this.toString(), this);
    }
    
    public double getValue() {
        return value;
    }
    
    public static EnumDouble fromValue(double value)
        throws java.lang.IllegalStateException {
        if (value1.value == value) {
            return value1;
        } else if (value2.value == value) {
            return value2;
        }
        throw new IllegalArgumentException();
    }
    
    public static EnumDouble fromString(String value)
        throws java.lang.IllegalStateException {
        EnumDouble ret = (EnumDouble)valueMap.get(value);
        if (ret != null) {
            return ret;
        }
        if (value.equals("-1.0000000000000")) {
            return value1;
        } else if (value.equals("3.0000000000000")) {
            return value2;
        }
        throw new IllegalArgumentException();
    }
    
    public String toString() {
        return new Double(value).toString();
    }
    
    private Object readResolve()
        throws java.io.ObjectStreamException {
        return fromValue(getValue());
    }
    
    public boolean equals(Object obj) {
        if (!(obj instanceof EnumDouble)) {
            return false;
        }
        return ((EnumDouble)obj).value == value;
    }
    
    public int hashCode() {
        return new Double(value).toString().hashCode();
    }
}
