/**
 * instance_materialType.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;
import com.jmex.model.collada.types.SchemaString;

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

    private static final long serialVersionUID = 1L;

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

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

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

    public instance_materialType(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,
                "symbol"); tmpNode != null; tmpNode = getDomNextChild(
                Attribute, null, "symbol", tmpNode)) {
            internalAdjustPrefix(tmpNode, false);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Attribute, null,
                "target"); tmpNode != null; tmpNode = getDomNextChild(
                Attribute, null, "target", tmpNode)) {
            internalAdjustPrefix(tmpNode, false);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "bind"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "bind", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new bindType(tmpNode).adjustPrefix();
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "extra"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "extra", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new extraType(tmpNode).adjustPrefix();
        }
    }

    public static int getsymbolMinCount() {
        return 1;
    }

    public static int getsymbolMaxCount() {
        return 1;
    }

    public int getsymbolCount() {
        return getDomChildCount(Attribute, null, "symbol");
    }

    public boolean hassymbol() {
        return hasDomChild(Attribute, null, "symbol");
    }

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

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

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

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

    public SchemaNCName getsymbolValueAtCursor(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 getsymbol() throws Exception {
        return getsymbolAt(0);
    }

    public void removesymbolAt(int index) {
        removeDomChildAt(Attribute, null, "symbol", index);
    }

    public void removesymbol() {
        while (hassymbol())
            removesymbolAt(0);
    }

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

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

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

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

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

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

    public static int gettargetMinCount() {
        return 1;
    }

    public static int gettargetMaxCount() {
        return 1;
    }

    public int gettargetCount() {
        return getDomChildCount(Attribute, null, "target");
    }

    public boolean hastarget() {
        return hasDomChild(Attribute, null, "target");
    }

    public SchemaString newtarget() {
        return new SchemaString();
    }

    public SchemaString gettargetAt(int index) throws Exception {
        return new SchemaString(getDomNodeValue(dereference(getDomChildAt(
                Attribute, null, "target", index))));
    }

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

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

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

    public SchemaString gettarget() throws Exception {
        return gettargetAt(0);
    }

    public void removetargetAt(int index) {
        removeDomChildAt(Attribute, null, "target", index);
    }

    public void removetarget() {
        while (hastarget())
            removetargetAt(0);
    }

    public void addtarget(SchemaString value) {
        if (value.isNull() == false) {
            appendDomChild(Attribute, null, "target", value.toString());
        }
    }

    public void addtarget(String value) throws Exception {
        addtarget(new SchemaString(value));
    }

    public void inserttargetAt(SchemaString value, int index) {
        insertDomChildAt(Attribute, null, "target", index, value.toString());
    }

    public void inserttargetAt(String value, int index) throws Exception {
        inserttargetAt(new SchemaString(value), index);
    }

    public void replacetargetAt(SchemaString value, int index) {
        replaceDomChildAt(Attribute, null, "target", index, value.toString());
    }

    public void replacetargetAt(String value, int index) throws Exception {
        replacetargetAt(new SchemaString(value), index);
    }

    public static int getbindMinCount() {
        return 0;
    }

    public static int getbindMaxCount() {
        return Integer.MAX_VALUE;
    }

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

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

    public bindType newbind() {
        return new bindType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "bind"));
    }

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

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

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

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

    public bindType getbind() throws Exception {
        return getbindAt(0);
    }

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

    public void removebind() {
        while (hasbind())
            removebindAt(0);
    }

    public void addbind(bindType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "bind", value);
    }

    public void insertbindAt(bindType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "bind", index, value);
    }

    public void replacebindAt(bindType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "bind", index, value);
    }

    public static int getextraMinCount() {
        return 0;
    }

    public static int getextraMaxCount() {
        return Integer.MAX_VALUE;
    }

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

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

    public extraType newextra() {
        return new extraType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "extra"));
    }

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

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

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

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

    public extraType getextra() throws Exception {
        return getextraAt(0);
    }

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

    public void removeextra() {
        while (hasextra())
            removeextraAt(0);
    }

    public void addextra(extraType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "extra", value);
    }

    public void insertextraAt(extraType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "extra", index, value);
    }

    public void replaceextraAt(extraType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "extra", index, value);
    }

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