/*
 * An XML document type.
 * Localname: SetResourceProperties
 * Namespace: http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.resource.properties.impl;
/**
 * A document containing one SetResourceProperties(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class SetResourcePropertiesDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument
{
    
    public SetResourcePropertiesDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SETRESOURCEPROPERTIES$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd", "SetResourceProperties");
    
    
    /**
     * Gets the "SetResourceProperties" element
     */
    public org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties getSetResourceProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties)get_store().find_element_user(SETRESOURCEPROPERTIES$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SetResourceProperties" element
     */
    public void setSetResourceProperties(org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties setResourceProperties)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties)get_store().find_element_user(SETRESOURCEPROPERTIES$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties)get_store().add_element_user(SETRESOURCEPROPERTIES$0);
            }
            target.set(setResourceProperties);
        }
    }
    
    /**
     * Appends and returns a new empty "SetResourceProperties" element
     */
    public org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties addNewSetResourceProperties()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties target = null;
            target = (org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties)get_store().add_element_user(SETRESOURCEPROPERTIES$0);
            return target;
        }
    }
    /**
     * An XML SetResourceProperties(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class SetResourcePropertiesImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.resource.properties.SetResourcePropertiesDocument.SetResourceProperties
    {
        
        public SetResourcePropertiesImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName INSERT$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd", "Insert");
        private static final javax.xml.namespace.QName UPDATE$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd", "Update");
        private static final javax.xml.namespace.QName DELETE$4 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd", "Delete");
        
        
        /**
         * Gets array of all "Insert" elements
         */
        public org.activemq.ws.xmlbeans.resource.properties.InsertType[] getInsertArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(INSERT$0, targetList);
                org.activemq.ws.xmlbeans.resource.properties.InsertType[] result = new org.activemq.ws.xmlbeans.resource.properties.InsertType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Insert" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.InsertType getInsertArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.InsertType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.InsertType)get_store().find_element_user(INSERT$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Insert" element
         */
        public int sizeOfInsertArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(INSERT$0);
            }
        }
        
        /**
         * Sets array of all "Insert" element
         */
        public void setInsertArray(org.activemq.ws.xmlbeans.resource.properties.InsertType[] insertArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(insertArray, INSERT$0);
            }
        }
        
        /**
         * Sets ith "Insert" element
         */
        public void setInsertArray(int i, org.activemq.ws.xmlbeans.resource.properties.InsertType insert)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.InsertType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.InsertType)get_store().find_element_user(INSERT$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(insert);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Insert" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.InsertType insertNewInsert(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.InsertType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.InsertType)get_store().insert_element_user(INSERT$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Insert" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.InsertType addNewInsert()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.InsertType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.InsertType)get_store().add_element_user(INSERT$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "Insert" element
         */
        public void removeInsert(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(INSERT$0, i);
            }
        }
        
        /**
         * Gets array of all "Update" elements
         */
        public org.activemq.ws.xmlbeans.resource.properties.UpdateType[] getUpdateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(UPDATE$2, targetList);
                org.activemq.ws.xmlbeans.resource.properties.UpdateType[] result = new org.activemq.ws.xmlbeans.resource.properties.UpdateType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Update" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.UpdateType getUpdateArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.UpdateType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.UpdateType)get_store().find_element_user(UPDATE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Update" element
         */
        public int sizeOfUpdateArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(UPDATE$2);
            }
        }
        
        /**
         * Sets array of all "Update" element
         */
        public void setUpdateArray(org.activemq.ws.xmlbeans.resource.properties.UpdateType[] updateArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(updateArray, UPDATE$2);
            }
        }
        
        /**
         * Sets ith "Update" element
         */
        public void setUpdateArray(int i, org.activemq.ws.xmlbeans.resource.properties.UpdateType update)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.UpdateType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.UpdateType)get_store().find_element_user(UPDATE$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(update);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Update" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.UpdateType insertNewUpdate(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.UpdateType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.UpdateType)get_store().insert_element_user(UPDATE$2, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Update" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.UpdateType addNewUpdate()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.UpdateType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.UpdateType)get_store().add_element_user(UPDATE$2);
                return target;
            }
        }
        
        /**
         * Removes the ith "Update" element
         */
        public void removeUpdate(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(UPDATE$2, i);
            }
        }
        
        /**
         * Gets array of all "Delete" elements
         */
        public org.activemq.ws.xmlbeans.resource.properties.DeleteType[] getDeleteArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(DELETE$4, targetList);
                org.activemq.ws.xmlbeans.resource.properties.DeleteType[] result = new org.activemq.ws.xmlbeans.resource.properties.DeleteType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Delete" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.DeleteType getDeleteArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.DeleteType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.DeleteType)get_store().find_element_user(DELETE$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Delete" element
         */
        public int sizeOfDeleteArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(DELETE$4);
            }
        }
        
        /**
         * Sets array of all "Delete" element
         */
        public void setDeleteArray(org.activemq.ws.xmlbeans.resource.properties.DeleteType[] deleteArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(deleteArray, DELETE$4);
            }
        }
        
        /**
         * Sets ith "Delete" element
         */
        public void setDeleteArray(int i, org.activemq.ws.xmlbeans.resource.properties.DeleteType delete)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.DeleteType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.DeleteType)get_store().find_element_user(DELETE$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(delete);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Delete" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.DeleteType insertNewDelete(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.DeleteType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.DeleteType)get_store().insert_element_user(DELETE$4, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Delete" element
         */
        public org.activemq.ws.xmlbeans.resource.properties.DeleteType addNewDelete()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.resource.properties.DeleteType target = null;
                target = (org.activemq.ws.xmlbeans.resource.properties.DeleteType)get_store().add_element_user(DELETE$4);
                return target;
            }
        }
        
        /**
         * Removes the ith "Delete" element
         */
        public void removeDelete(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(DELETE$4, i);
            }
        }
    }
}
