/**
 * morphType.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 morphType extends com.jmex.model.collada.xml.Node {

    private static final long serialVersionUID = 1L;

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

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

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

    public morphType(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,
                "method"); tmpNode != null; tmpNode = getDomNextChild(
                Attribute, null, "method", tmpNode)) {
            internalAdjustPrefix(tmpNode, false);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Attribute, null,
                "source"); tmpNode != null; tmpNode = getDomNextChild(
                Attribute, null, "source", tmpNode)) {
            internalAdjustPrefix(tmpNode, false);
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "source"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "source", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new sourceType(tmpNode).adjustPrefix();
        }
        for (org.w3c.dom.Node tmpNode = getDomFirstChild(Element,
                "http://www.collada.org/2005/11/COLLADASchema", "targets"); tmpNode != null; tmpNode = getDomNextChild(
                Element, "http://www.collada.org/2005/11/COLLADASchema",
                "targets", tmpNode)) {
            internalAdjustPrefix(tmpNode, true);
            new targetsType(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 getmethodMinCount() {
        return 0;
    }

    public static int getmethodMaxCount() {
        return 1;
    }

    public int getmethodCount() {
        return getDomChildCount(Attribute, null, "method");
    }

    public boolean hasmethod() {
        return hasDomChild(Attribute, null, "method");
    }

    public MorphMethodType newmethod() {
        return new MorphMethodType();
    }

    public MorphMethodType getmethodAt(int index) throws Exception {
        return new MorphMethodType(getDomNodeValue(dereference(getDomChildAt(
                Attribute, null, "method", index))));
    }

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

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

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

    public MorphMethodType getmethod() throws Exception {
        return getmethodAt(0);
    }

    public void removemethodAt(int index) {
        removeDomChildAt(Attribute, null, "method", index);
    }

    public void removemethod() {
        while (hasmethod())
            removemethodAt(0);
    }

    public void addmethod(MorphMethodType value) {
        if (value.isNull() == false) {
            appendDomChild(Attribute, null, "method", value.toString());
        }
    }

    public void addmethod(String value) throws Exception {
        addmethod(new MorphMethodType(value));
    }

    public void insertmethodAt(MorphMethodType value, int index) {
        insertDomChildAt(Attribute, null, "method", index, value.toString());
    }

    public void insertmethodAt(String value, int index) throws Exception {
        insertmethodAt(new MorphMethodType(value), index);
    }

    public void replacemethodAt(MorphMethodType value, int index) {
        replaceDomChildAt(Attribute, null, "method", index, value.toString());
    }

    public void replacemethodAt(String value, int index) throws Exception {
        replacemethodAt(new MorphMethodType(value), index);
    }

    public static int getsourceMinCount() {
        return 1;
    }

    public static int getsourceMaxCount() {
        return 1;
    }

    public int getsourceCount() {
        return getDomChildCount(Attribute, null, "source");
    }

    public boolean hassource() {
        return hasDomChild(Attribute, null, "source");
    }

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

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

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

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

    public SchemaString getsourceValueAtCursor(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 getsource() throws Exception {
        return getsourceAt(0);
    }

    public void removesourceAt(int index) {
        removeDomChildAt(Attribute, null, "source", index);
    }

    public void removesource() {
        while (hassource())
            removesourceAt(0);
    }

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

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

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

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

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

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

    public static int getsource2MinCount() {
        return 2;
    }

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

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

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

    public sourceType newsource2() {
        return new sourceType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "source"));
    }

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

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

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

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

    public sourceType getsource2() throws Exception {
        return getsource2At(0);
    }

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

    public void removesource2() {
        while (hassource2())
            removesource2At(0);
    }

    public void addsource2(sourceType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "source", value);
    }

    public void insertsource2At(sourceType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "source", index, value);
    }

    public void replacesource2At(sourceType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "source", index, value);
    }

    public static int gettargetsMinCount() {
        return 1;
    }

    public static int gettargetsMaxCount() {
        return 1;
    }

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

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

    public targetsType newtargets() {
        return new targetsType(domNode.getOwnerDocument().createElementNS(
                "http://www.collada.org/2005/11/COLLADASchema", "targets"));
    }

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

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

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

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

    public targetsType gettargets() throws Exception {
        return gettargetsAt(0);
    }

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

    public void removetargets() {
        while (hastargets())
            removetargetsAt(0);
    }

    public void addtargets(targetsType value) {
        appendDomElement("http://www.collada.org/2005/11/COLLADASchema",
                "targets", value);
    }

    public void inserttargetsAt(targetsType value, int index) {
        insertDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "targets", index, value);
    }

    public void replacetargetsAt(targetsType value, int index) {
        replaceDomElementAt("http://www.collada.org/2005/11/COLLADASchema",
                "targets", 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;
    }
}
