/**
 * gl_logic_op_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_logic_op_type extends SchemaString {

    private static final long serialVersionUID = 1L;
    public static final int ECLEAR = 0; /* CLEAR */
    public static final int EAND = 1; /* AND */
    public static final int EAND_REVERSE = 2; /* AND_REVERSE */
    public static final int ECOPY = 3; /* COPY */
    public static final int EAND_INVERTED = 4; /* AND_INVERTED */
    public static final int ENOOP = 5; /* NOOP */
    public static final int EXOR = 6; /* XOR */
    public static final int EOR = 7; /* OR */
    public static final int ENOR = 8; /* NOR */
    public static final int EEQUIV = 9; /* EQUIV */
    public static final int EINVERT = 10; /* INVERT */
    public static final int EOR_REVERSE = 11; /* OR_REVERSE */
    public static final int ECOPY_INVERTED = 12; /* COPY_INVERTED */
    public static final int ENAND = 13; /* NAND */
    public static final int ESET = 14; /* SET */

    public static String[] sEnumValues = { "CLEAR", "AND", "AND_REVERSE",
            "COPY", "AND_INVERTED", "NOOP", "XOR", "OR", "NOR", "EQUIV",
            "INVERT", "OR_REVERSE", "COPY_INVERTED", "NAND", "SET", };

    public gl_logic_op_type() {
        super();
    }

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

    public gl_logic_op_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_logic_op_type is invalid.");
    }
}
