/**
 * cg_surface_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;

public class cg_surface_type extends fx_surface_common {

    private static final long serialVersionUID = 1L;

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

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

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

    public cg_surface_type(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(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "generator"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "generator", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new generatorType(tmpNode).adjustPrefix();
        }

        super.adjustPrefix();
    }

    public static int getgeneratorMinCount() {
        return 0;
    }

    public static int getgeneratorMaxCount() {
        return 1;
    }

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

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

    public generatorType newgenerator() {
        return new generatorType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "generator"));
    }

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

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

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

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

    public generatorType getgenerator() throws Exception {
        return getgeneratorAt(0);
    }

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

    public void removegenerator() {
        while (hasgenerator())
            removegeneratorAt(0);
    }

    public void addgenerator(generatorType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "generator", value);
    }

    public void insertgeneratorAt(generatorType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "generator", index, value);
    }

    public void replacegeneratorAt(generatorType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "generator", index, value);
    }

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