/**
 * gl_blend_type.java This file was generated by XMLSpy 2006sp2 Enterprise
 * Edition. YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE OVERWRITTEN WHEN
 * YOU RE-RUN CODE GENERATION. Refer to the XMLSpy Documentation for further
 * details. http://www.altova.com/xmlspy
 */

package com.jmex.model.collada.schema;

import com.jmex.model.collada.types.SchemaString;

public class gl_blend_type extends SchemaString {

    private static final long serialVersionUID = 1L;
    public static final int EZERO = 0; /* ZERO */
    public static final int EONE = 1; /* ONE */
    public static final int ESRC_COLOR = 2; /* SRC_COLOR */
    public static final int EONE_MINUS_SRC_COLOR = 3; /* ONE_MINUS_SRC_COLOR */
    public static final int EDEST_COLOR = 4; /* DEST_COLOR */
    public static final int EONE_MINUS_DEST_COLOR = 5; /* ONE_MINUS_DEST_COLOR */
    public static final int ESRC_ALPHA = 6; /* SRC_ALPHA */
    public static final int EONE_MINUS_SRC_ALPHA = 7; /* ONE_MINUS_SRC_ALPHA */
    public static final int EDST_ALPHA = 8; /* DST_ALPHA */
    public static final int EONE_MINUS_DST_ALPHA = 9; /* ONE_MINUS_DST_ALPHA */
    public static final int ECONSTANT_COLOR = 10; /* CONSTANT_COLOR */
    public static final int EONE_MINUS_CONSTANT_COLOR = 11; /* ONE_MINUS_CONSTANT_COLOR */
    public static final int ECONSTANT_ALPHA = 12; /* CONSTANT_ALPHA */
    public static final int EONE_MINUS_CONSTANT_ALPHA = 13; /* ONE_MINUS_CONSTANT_ALPHA */
    public static final int ESRC_ALPHA_SATURATE = 14; /* SRC_ALPHA_SATURATE */

    public static String[] sEnumValues = { "ZERO", "ONE", "SRC_COLOR",
            "ONE_MINUS_SRC_COLOR", "DEST_COLOR", "ONE_MINUS_DEST_COLOR",
            "SRC_ALPHA", "ONE_MINUS_SRC_ALPHA", "DST_ALPHA",
            "ONE_MINUS_DST_ALPHA", "CONSTANT_COLOR",
            "ONE_MINUS_CONSTANT_COLOR", "CONSTANT_ALPHA",
            "ONE_MINUS_CONSTANT_ALPHA", "SRC_ALPHA_SATURATE", };

    public gl_blend_type() {
        super();
    }

    public gl_blend_type(String newValue) {
        super(newValue);
        validate();
    }

    public gl_blend_type(SchemaString newValue) {
        super(newValue);
        validate();
    }

    public static int getEnumerationCount() {
        return sEnumValues.length;
    }

    public static String getEnumerationValue(int index) {
        return sEnumValues[index];
    }

    public static boolean isValidEnumerationValue(String val) {
        for (int i = 0; i < sEnumValues.length; i++) {
            if (val.equals(sEnumValues[i]))
                return true;
        }
        return false;
    }

    public void validate() {

        if (!isValidEnumerationValue(toString()))
            throw new com.jmex.model.collada.xml.XmlException(
                    "Value of gl_blend_type is invalid.");
    }
}
