/**
 * gles_texture_unit.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.SchemaNCName;

public class gles_texture_unit extends com.jmex.model.collada.xml.Node {

    private static final long serialVersionUID = 1L;

    public gles_texture_unit(gles_texture_unit node) {
        super(node);
    }

    public gles_texture_unit(org.w3c.dom.Node node) {
        super(node);
    }

    public gles_texture_unit(org.w3c.dom.Document doc) {
        super(doc);
    }

    public gles_texture_unit(com.jmex.model.collada.xml.Document doc,
            String namespaceURI, String prefix, String name) {
        super(doc, namespaceURI, prefix, name);
    }

    public void adjustPrefix() {
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Attribute, null, "sid"); tmpNode != null; tmpNode = getDomNextChild(
                Attribute, null, "sid", tmpNode)) {
            internalAdjustPrefix(tmpNode, false);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "surface", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "sampler_state"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "texcoord", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new texcoordType(tmpNode).adjustPrefix();
        }
    }

    public static int getsidMinCount() {
        return 0;
    }

    public static int getsidMaxCount() {
        return 1;
    }

    public int getsidCount() {
        return getDomChildCount(Attribute, null, "sid");
    }

    public boolean hassid() {
        return hasDomChild(Attribute, null, "sid");
    }

    public SchemaNCName newsid() {
        return new SchemaNCName();
    }

    public SchemaNCName getsidAt(int index) throws Exception {
        return new SchemaNCName(getDomNodeValue(dereference(getDomChildAt(
                Attribute, null, "sid", index))));
    }

    public org.w3c.dom.Node getStartingsidCursor() throws Exception {
        return getDomFirstChild(Attribute, null, "sid");
    }

    public org.w3c.dom.Node getAdvancedsidCursor(org.w3c.dom.Node curNode)
            throws Exception {
        return getDomNextChild(Attribute, null, "sid", curNode);
    }

    public SchemaNCName getsidValueAtCursor(org.w3c.dom.Node curNode)
            throws Exception {
        if (curNode == null)
            throw new com.jmex.model.collada.xml.XmlException("Out of range");
        else
            return new SchemaNCName(getDomNodeValue(dereference(curNode)));
    }

    public SchemaNCName getsid() throws Exception {
        return getsidAt(0);
    }

    public void removesidAt(int index) {
        removeDomChildAt(Attribute, null, "sid", index);
    }

    public void removesid() {
        while (hassid())
            removesidAt(0);
    }

    public void addsid(SchemaNCName value) {
        if (value.isNull() == false) {
            appendDomChild(Attribute, null, "sid", value.toString());
        }
    }

    public void addsid(String value) throws Exception {
        addsid(new SchemaNCName(value));
    }

    public void insertsidAt(SchemaNCName value, int index) {
        insertDomChildAt(Attribute, null, "sid", index, value.toString());
    }

    public void insertsidAt(String value, int index) throws Exception {
        insertsidAt(new SchemaNCName(value), index);
    }

    public void replacesidAt(SchemaNCName value, int index) {
        replaceDomChildAt(Attribute, null, "sid", index, value.toString());
    }

    public void replacesidAt(String value, int index) throws Exception {
        replacesidAt(new SchemaNCName(value), index);
    }

    public static int getsurfaceMinCount() {
        return 0;
    }

    public static int getsurfaceMaxCount() {
        return 1;
    }

    public int getsurfaceCount() {
        return getDomChildCount(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface");
    }

    public boolean hassurface() {
        return hasDomChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface");
    }

    public SchemaNCName newsurface() {
        return new SchemaNCName();
    }

    public SchemaNCName getsurfaceAt(int index) throws Exception {
        return new SchemaNCName(getDomNodeValue(dereference(getDomChildAt(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "surface", index))));
    }

    public org.w3c.dom.Node getStartingsurfaceCursor() throws Exception {
        return getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface");
    }

    public org.w3c.dom.Node getAdvancedsurfaceCursor(org.w3c.dom.Node curNode)
            throws Exception {
        return getDomNextChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface",
                curNode);
    }

    public SchemaNCName getsurfaceValueAtCursor(org.w3c.dom.Node curNode)
            throws Exception {
        if (curNode == null)
            throw new com.jmex.model.collada.xml.XmlException("Out of range");
        else
            return new SchemaNCName(getDomNodeValue(dereference(curNode)));
    }

    public SchemaNCName getsurface() throws Exception {
        return getsurfaceAt(0);
    }

    public void removesurfaceAt(int index) {
        removeDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface",
                index);
    }

    public void removesurface() {
        while (hassurface())
            removesurfaceAt(0);
    }

    public void addsurface(SchemaNCName value) {
        if (value.isNull() == false) {
            appendDomChild(Element,
                    "http://www.collada.org/2005/11/COLLADASchema", "surface",
                    value.toString());
        }
    }

    public void addsurface(String value) throws Exception {
        addsurface(new SchemaNCName(value));
    }

    public void insertsurfaceAt(SchemaNCName value, int index) {
        insertDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface",
                index, value.toString());
    }

    public void insertsurfaceAt(String value, int index) throws Exception {
        insertsurfaceAt(new SchemaNCName(value), index);
    }

    public void replacesurfaceAt(SchemaNCName value, int index) {
        replaceDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "surface",
                index, value.toString());
    }

    public void replacesurfaceAt(String value, int index) throws Exception {
        replacesurfaceAt(new SchemaNCName(value), index);
    }

    public static int getsampler_stateMinCount() {
        return 0;
    }

    public static int getsampler_stateMaxCount() {
        return 1;
    }

    public int getsampler_stateCount() {
        return getDomChildCount(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "sampler_state");
    }

    public boolean hassampler_state() {
        return hasDomChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "sampler_state");
    }

    public SchemaNCName newsampler_state() {
        return new SchemaNCName();
    }

    public SchemaNCName getsampler_stateAt(int index) throws Exception {
        return new SchemaNCName(getDomNodeValue(dereference(getDomChildAt(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", index))));
    }

    public org.w3c.dom.Node getStartingsampler_stateCursor() throws Exception {
        return getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "sampler_state");
    }

    public org.w3c.dom.Node getAdvancedsampler_stateCursor(
            org.w3c.dom.Node curNode) throws Exception {
        return getDomNextChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", curNode);
    }

    public SchemaNCName getsampler_stateValueAtCursor(org.w3c.dom.Node curNode)
            throws Exception {
        if (curNode == null)
            throw new com.jmex.model.collada.xml.XmlException("Out of range");
        else
            return new SchemaNCName(getDomNodeValue(dereference(curNode)));
    }

    public SchemaNCName getsampler_state() throws Exception {
        return getsampler_stateAt(0);
    }

    public void removesampler_stateAt(int index) {
        removeDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", index);
    }

    public void removesampler_state() {
        while (hassampler_state())
            removesampler_stateAt(0);
    }

    public void addsampler_state(SchemaNCName value) {
        if (value.isNull() == false) {
            appendDomChild(Element,
                    "http://www.collada.org/2005/11/COLLADASchema",
                    "sampler_state", value.toString());
        }
    }

    public void addsampler_state(String value) throws Exception {
        addsampler_state(new SchemaNCName(value));
    }

    public void insertsampler_stateAt(SchemaNCName value, int index) {
        insertDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", index, value.toString());
    }

    public void insertsampler_stateAt(String value, int index) throws Exception {
        insertsampler_stateAt(new SchemaNCName(value), index);
    }

    public void replacesampler_stateAt(SchemaNCName value, int index) {
        replaceDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema",
                "sampler_state", index, value.toString());
    }

    public void replacesampler_stateAt(String value, int index)
            throws Exception {
        replacesampler_stateAt(new SchemaNCName(value), index);
    }

    public static int gettexcoordMinCount() {
        return 0;
    }

    public static int gettexcoordMaxCount() {
        return 1;
    }

    public int gettexcoordCount() {
        return getDomChildCount(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord");
    }

    public boolean hastexcoord() {
        return hasDomChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord");
    }

    public texcoordType newtexcoord() {
        return new texcoordType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord"));
    }

    public texcoordType gettexcoordAt(int index) throws Exception {
        return new texcoordType(dereference(getDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord",
                index)));
    }

    public org.w3c.dom.Node getStartingtexcoordCursor() throws Exception {
        return getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord");
    }

    public org.w3c.dom.Node getAdvancedtexcoordCursor(org.w3c.dom.Node curNode)
            throws Exception {
        return getDomNextChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord",
                curNode);
    }

    public texcoordType gettexcoordValueAtCursor(org.w3c.dom.Node curNode)
            throws Exception {
        if (curNode == null)
            throw new com.jmex.model.collada.xml.XmlException("Out of range");
        else
            return new texcoordType(dereference(curNode));
    }

    public texcoordType gettexcoord() throws Exception {
        return gettexcoordAt(0);
    }

    public void removetexcoordAt(int index) {
        removeDomChildAt(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "texcoord",
                index);
    }

    public void removetexcoord() {
        while (hastexcoord())
            removetexcoordAt(0);
    }

    public void addtexcoord(texcoordType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "texcoord", value);
    }

    public void inserttexcoordAt(texcoordType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "texcoord", index, value);
    }

    public void replacetexcoordAt(texcoordType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "texcoord", index, value);
    }

    private org.w3c.dom.Node dereference(org.w3c.dom.Node node) {
        return node;
    }
}
