/*
 * An XML document type.
 * Localname: SequenceAcknowledgement
 * Namespace: http://schemas.xmlsoap.org/ws/2004/03/rm
 * Java type: org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument
 *
 * Automatically generated - do not modify.
 */
package org.xmlsoap.schemas.ws.x2004.x03.rm.impl;

/**
 * A document containing one SequenceAcknowledgement(@http://schemas.xmlsoap.org/ws/2004/03/rm) element.
 * <p/>
 * This is a complex type.
 */
public class SequenceAcknowledgementDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument {

    public SequenceAcknowledgementDocumentImpl(org.apache.xmlbeans.SchemaType sType) {
        super(sType);
    }

    private static final javax.xml.namespace.QName SEQUENCEACKNOWLEDGEMENT$0 =
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "SequenceAcknowledgement");


    /**
     * Gets the "SequenceAcknowledgement" element
     */
    public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement getSequenceAcknowledgement() {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement) get_store().find_element_user(SEQUENCEACKNOWLEDGEMENT$0, 0);
            if (target == null) {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "SequenceAcknowledgement" element
     */
    public void setSequenceAcknowledgement(org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement sequenceAcknowledgement) {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement) get_store().find_element_user(SEQUENCEACKNOWLEDGEMENT$0, 0);
            if (target == null) {
                target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement) get_store().add_element_user(SEQUENCEACKNOWLEDGEMENT$0);
            }
            target.set(sequenceAcknowledgement);
        }
    }

    /**
     * Appends and returns a new empty "SequenceAcknowledgement" element
     */
    public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement addNewSequenceAcknowledgement() {
        synchronized (monitor()) {
            check_orphaned();
            org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement target = null;
            target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement) get_store().add_element_user(SEQUENCEACKNOWLEDGEMENT$0);
            return target;
        }
    }

    /**
     * An XML SequenceAcknowledgement(@http://schemas.xmlsoap.org/ws/2004/03/rm).
     * <p/>
     * This is a complex type.
     */
    public static class SequenceAcknowledgementImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement {

        public SequenceAcknowledgementImpl(org.apache.xmlbeans.SchemaType sType) {
            super(sType);
        }

        private static final javax.xml.namespace.QName IDENTIFIER$0 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2002/07/utility", "Identifier");
        private static final javax.xml.namespace.QName ACKNOWLEDGEMENTRANGE$2 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "AcknowledgementRange");
        private static final javax.xml.namespace.QName NACK$4 =
                new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/03/rm", "Nack");


        /**
         * Gets the "Identifier" element
         */
        public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI getIdentifier() {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
                target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().find_element_user(IDENTIFIER$0, 0);
                if (target == null) {
                    return null;
                }
                return target;
            }
        }

        /**
         * Sets the "Identifier" element
         */
        public void setIdentifier(org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI identifier) {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
                target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().find_element_user(IDENTIFIER$0, 0);
                if (target == null) {
                    target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().add_element_user(IDENTIFIER$0);
                }
                target.set(identifier);
            }
        }

        /**
         * Appends and returns a new empty "Identifier" element
         */
        public org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI addNewIdentifier() {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI target = null;
                target = (org.xmlsoap.schemas.ws.x2002.x07.utility.AttributedURI) get_store().add_element_user(IDENTIFIER$0);
                return target;
            }
        }

        /**
         * Gets array of all "AcknowledgementRange" elements
         */
        public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] getAcknowledgementRangeArray() {
            synchronized (monitor()) {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(ACKNOWLEDGEMENTRANGE$2, targetList);
                org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] result = new org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }

        /**
         * Gets ith "AcknowledgementRange" element
         */
        public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange getAcknowledgementRangeArray(int i) {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange) get_store().find_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }

        /**
         * Returns number of "AcknowledgementRange" element
         */
        public int sizeOfAcknowledgementRangeArray() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(ACKNOWLEDGEMENTRANGE$2);
            }
        }

        /**
         * Sets array of all "AcknowledgementRange" element
         */
        public void setAcknowledgementRangeArray(org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange[] acknowledgementRangeArray) {
            synchronized (monitor()) {
                check_orphaned();
                arraySetterHelper(acknowledgementRangeArray, ACKNOWLEDGEMENTRANGE$2);
            }
        }

        /**
         * Sets ith "AcknowledgementRange" element
         */
        public void setAcknowledgementRangeArray(int i, org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange acknowledgementRange) {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange) get_store().find_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                target.set(acknowledgementRange);
            }
        }

        /**
         * Inserts and returns a new empty value (as xml) as the ith "AcknowledgementRange" element
         */
        public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange insertNewAcknowledgementRange(int i) {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange) get_store().insert_element_user(ACKNOWLEDGEMENTRANGE$2, i);
                return target;
            }
        }

        /**
         * Appends and returns a new empty value (as xml) as the last "AcknowledgementRange" element
         */
        public org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange addNewAcknowledgementRange() {
            synchronized (monitor()) {
                check_orphaned();
                org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange target = null;
                target = (org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange) get_store().add_element_user(ACKNOWLEDGEMENTRANGE$2);
                return target;
            }
        }

        /**
         * Removes the ith "AcknowledgementRange" element
         */
        public void removeAcknowledgementRange(int i) {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(ACKNOWLEDGEMENTRANGE$2, i);
            }
        }

        /**
         * Gets array of all "Nack" elements
         */
        public java.math.BigInteger[] getNackArray() {
            synchronized (monitor()) {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(NACK$4, targetList);
                java.math.BigInteger[] result = new java.math.BigInteger[targetList.size()];
                for (int i = 0, len = targetList.size(); i < len; i++) {
                    result[i] = ((org.apache.xmlbeans.SimpleValue) targetList.get(i)).getBigIntegerValue();
                }
                return result;
            }
        }

        /**
         * Gets ith "Nack" element
         */
        public java.math.BigInteger getNackArray(int i) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue) get_store().find_element_user(NACK$4, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                return target.getBigIntegerValue();
            }
        }

        /**
         * Gets (as xml) array of all "Nack" elements
         */
        public org.apache.xmlbeans.XmlUnsignedLong[] xgetNackArray() {
            synchronized (monitor()) {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(NACK$4, targetList);
                org.apache.xmlbeans.XmlUnsignedLong[] result = new org.apache.xmlbeans.XmlUnsignedLong[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }

        /**
         * Gets (as xml) ith "Nack" element
         */
        public org.apache.xmlbeans.XmlUnsignedLong xgetNackArray(int i) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.XmlUnsignedLong target = null;
                target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_element_user(NACK$4, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                return (org.apache.xmlbeans.XmlUnsignedLong) target;
            }
        }

        /**
         * Returns number of "Nack" element
         */
        public int sizeOfNackArray() {
            synchronized (monitor()) {
                check_orphaned();
                return get_store().count_elements(NACK$4);
            }
        }

        /**
         * Sets array of all "Nack" element
         */
        public void setNackArray(java.math.BigInteger[] nackArray) {
            synchronized (monitor()) {
                check_orphaned();
                arraySetterHelper(nackArray, NACK$4);
            }
        }

        /**
         * Sets ith "Nack" element
         */
        public void setNackArray(int i, java.math.BigInteger nack) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue) get_store().find_element_user(NACK$4, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                target.setBigIntegerValue(nack);
            }
        }

        /**
         * Sets (as xml) array of all "Nack" element
         */
        public void xsetNackArray(org.apache.xmlbeans.XmlUnsignedLong[] nackArray) {
            synchronized (monitor()) {
                check_orphaned();
                arraySetterHelper(nackArray, NACK$4);
            }
        }

        /**
         * Sets (as xml) ith "Nack" element
         */
        public void xsetNackArray(int i, org.apache.xmlbeans.XmlUnsignedLong nack) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.XmlUnsignedLong target = null;
                target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_element_user(NACK$4, i);
                if (target == null) {
                    throw new IndexOutOfBoundsException();
                }
                target.set(nack);
            }
        }

        /**
         * Inserts the value as the ith "Nack" element
         */
        public void insertNack(int i, java.math.BigInteger nack) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target =
                        (org.apache.xmlbeans.SimpleValue) get_store().insert_element_user(NACK$4, i);
                target.setBigIntegerValue(nack);
            }
        }

        /**
         * Appends the value as the last "Nack" element
         */
        public void addNack(java.math.BigInteger nack) {
            synchronized (monitor()) {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue) get_store().add_element_user(NACK$4);
                target.setBigIntegerValue(nack);
            }
        }

        /**
         * Removes the ith "Nack" element
         */
        public void removeNack(int i) {
            synchronized (monitor()) {
                check_orphaned();
                get_store().remove_element(NACK$4, i);
            }
        }

        /**
         * An XML AcknowledgementRange(@http://schemas.xmlsoap.org/ws/2004/03/rm).
         * <p/>
         * This is a complex type.
         */
        public static class AcknowledgementRangeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.xmlsoap.schemas.ws.x2004.x03.rm.SequenceAcknowledgementDocument.SequenceAcknowledgement.AcknowledgementRange {

            public AcknowledgementRangeImpl(org.apache.xmlbeans.SchemaType sType) {
                super(sType);
            }

            private static final javax.xml.namespace.QName UPPER$0 =
                    new javax.xml.namespace.QName("", "Upper");
            private static final javax.xml.namespace.QName LOWER$2 =
                    new javax.xml.namespace.QName("", "Lower");


            /**
             * Gets the "Upper" attribute
             */
            public java.math.BigInteger getUpper() {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(UPPER$0);
                    if (target == null) {
                        return null;
                    }
                    return target.getBigIntegerValue();
                }
            }

            /**
             * Gets (as xml) the "Upper" attribute
             */
            public org.apache.xmlbeans.XmlUnsignedLong xgetUpper() {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_attribute_user(UPPER$0);
                    return target;
                }
            }

            /**
             * Sets the "Upper" attribute
             */
            public void setUpper(java.math.BigInteger upper) {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(UPPER$0);
                    if (target == null) {
                        target = (org.apache.xmlbeans.SimpleValue) get_store().add_attribute_user(UPPER$0);
                    }
                    target.setBigIntegerValue(upper);
                }
            }

            /**
             * Sets (as xml) the "Upper" attribute
             */
            public void xsetUpper(org.apache.xmlbeans.XmlUnsignedLong upper) {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_attribute_user(UPPER$0);
                    if (target == null) {
                        target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().add_attribute_user(UPPER$0);
                    }
                    target.set(upper);
                }
            }

            /**
             * Gets the "Lower" attribute
             */
            public java.math.BigInteger getLower() {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(LOWER$2);
                    if (target == null) {
                        return null;
                    }
                    return target.getBigIntegerValue();
                }
            }

            /**
             * Gets (as xml) the "Lower" attribute
             */
            public org.apache.xmlbeans.XmlUnsignedLong xgetLower() {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_attribute_user(LOWER$2);
                    return target;
                }
            }

            /**
             * Sets the "Lower" attribute
             */
            public void setLower(java.math.BigInteger lower) {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.SimpleValue target = null;
                    target = (org.apache.xmlbeans.SimpleValue) get_store().find_attribute_user(LOWER$2);
                    if (target == null) {
                        target = (org.apache.xmlbeans.SimpleValue) get_store().add_attribute_user(LOWER$2);
                    }
                    target.setBigIntegerValue(lower);
                }
            }

            /**
             * Sets (as xml) the "Lower" attribute
             */
            public void xsetLower(org.apache.xmlbeans.XmlUnsignedLong lower) {
                synchronized (monitor()) {
                    check_orphaned();
                    org.apache.xmlbeans.XmlUnsignedLong target = null;
                    target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().find_attribute_user(LOWER$2);
                    if (target == null) {
                        target = (org.apache.xmlbeans.XmlUnsignedLong) get_store().add_attribute_user(LOWER$2);
                    }
                    target.set(lower);
                }
            }
        }
    }
}
