/*
 * An XML document type.
 * Localname: ServiceGroupRP
 * Namespace: http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.servicegroup.impl;
/**
 * A document containing one ServiceGroupRP(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class ServiceGroupRPDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument
{
    
    public ServiceGroupRPDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SERVICEGROUPRP$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "ServiceGroupRP");
    
    
    /**
     * Gets the "ServiceGroupRP" element
     */
    public org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP getServiceGroupRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP)get_store().find_element_user(SERVICEGROUPRP$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "ServiceGroupRP" element
     */
    public void setServiceGroupRP(org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP serviceGroupRP)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP)get_store().find_element_user(SERVICEGROUPRP$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP)get_store().add_element_user(SERVICEGROUPRP$0);
            }
            target.set(serviceGroupRP);
        }
    }
    
    /**
     * Appends and returns a new empty "ServiceGroupRP" element
     */
    public org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP addNewServiceGroupRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP target = null;
            target = (org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP)get_store().add_element_user(SERVICEGROUPRP$0);
            return target;
        }
    }
    /**
     * An XML ServiceGroupRP(@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class ServiceGroupRPImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.servicegroup.ServiceGroupRPDocument.ServiceGroupRP
    {
        
        public ServiceGroupRPImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName MEMBERSHIPCONTENTRULE$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "MembershipContentRule");
        private static final javax.xml.namespace.QName ENTRY$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd", "Entry");
        
        
        /**
         * Gets array of all "MembershipContentRule" elements
         */
        public org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule[] getMembershipContentRuleArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(MEMBERSHIPCONTENTRULE$0, targetList);
                org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule[] result = new org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "MembershipContentRule" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule getMembershipContentRuleArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule)get_store().find_element_user(MEMBERSHIPCONTENTRULE$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "MembershipContentRule" element
         */
        public int sizeOfMembershipContentRuleArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(MEMBERSHIPCONTENTRULE$0);
            }
        }
        
        /**
         * Sets array of all "MembershipContentRule" element
         */
        public void setMembershipContentRuleArray(org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule[] membershipContentRuleArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(membershipContentRuleArray, MEMBERSHIPCONTENTRULE$0);
            }
        }
        
        /**
         * Sets ith "MembershipContentRule" element
         */
        public void setMembershipContentRuleArray(int i, org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule membershipContentRule)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule)get_store().find_element_user(MEMBERSHIPCONTENTRULE$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(membershipContentRule);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "MembershipContentRule" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule insertNewMembershipContentRule(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule)get_store().insert_element_user(MEMBERSHIPCONTENTRULE$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "MembershipContentRule" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule addNewMembershipContentRule()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.MembershipContentRuleDocument.MembershipContentRule)get_store().add_element_user(MEMBERSHIPCONTENTRULE$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "MembershipContentRule" element
         */
        public void removeMembershipContentRule(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(MEMBERSHIPCONTENTRULE$0, i);
            }
        }
        
        /**
         * Gets array of all "Entry" elements
         */
        public org.activemq.ws.xmlbeans.servicegroup.EntryType[] getEntryArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(ENTRY$2, targetList);
                org.activemq.ws.xmlbeans.servicegroup.EntryType[] result = new org.activemq.ws.xmlbeans.servicegroup.EntryType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Entry" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.EntryType getEntryArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.EntryType target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.EntryType)get_store().find_element_user(ENTRY$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Entry" element
         */
        public int sizeOfEntryArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ENTRY$2);
            }
        }
        
        /**
         * Sets array of all "Entry" element
         */
        public void setEntryArray(org.activemq.ws.xmlbeans.servicegroup.EntryType[] entryArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(entryArray, ENTRY$2);
            }
        }
        
        /**
         * Sets ith "Entry" element
         */
        public void setEntryArray(int i, org.activemq.ws.xmlbeans.servicegroup.EntryType entry)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.EntryType target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.EntryType)get_store().find_element_user(ENTRY$2, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(entry);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Entry" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.EntryType insertNewEntry(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.EntryType target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.EntryType)get_store().insert_element_user(ENTRY$2, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Entry" element
         */
        public org.activemq.ws.xmlbeans.servicegroup.EntryType addNewEntry()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.servicegroup.EntryType target = null;
                target = (org.activemq.ws.xmlbeans.servicegroup.EntryType)get_store().add_element_user(ENTRY$2);
                return target;
            }
        }
        
        /**
         * Removes the ith "Entry" element
         */
        public void removeEntry(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ENTRY$2, i);
            }
        }
    }
}
