/*
 * An XML document type.
 * Localname: NotificationBrokerRP
 * Namespace: http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.brokered.impl;
/**
 * A document containing one NotificationBrokerRP(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class NotificationBrokerRPDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument
{
    
    public NotificationBrokerRPDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName NOTIFICATIONBROKERRP$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "NotificationBrokerRP");
    
    
    /**
     * Gets the "NotificationBrokerRP" element
     */
    public org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP getNotificationBrokerRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP)get_store().find_element_user(NOTIFICATIONBROKERRP$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "NotificationBrokerRP" element
     */
    public void setNotificationBrokerRP(org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP notificationBrokerRP)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP)get_store().find_element_user(NOTIFICATIONBROKERRP$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP)get_store().add_element_user(NOTIFICATIONBROKERRP$0);
            }
            target.set(notificationBrokerRP);
        }
    }
    
    /**
     * Appends and returns a new empty "NotificationBrokerRP" element
     */
    public org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP addNewNotificationBrokerRP()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP target = null;
            target = (org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP)get_store().add_element_user(NOTIFICATIONBROKERRP$0);
            return target;
        }
    }
    /**
     * An XML NotificationBrokerRP(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class NotificationBrokerRPImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.brokered.NotificationBrokerRPDocument.NotificationBrokerRP
    {
        
        public NotificationBrokerRPImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName TOPIC$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic");
        private static final javax.xml.namespace.QName FIXEDTOPICSET$2 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "FixedTopicSet");
        private static final javax.xml.namespace.QName TOPICEXPRESSIONDIALECTS$4 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "TopicExpressionDialects");
        private static final javax.xml.namespace.QName REQUIRESREGISTRATION$6 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd", "RequiresRegistration");
        
        
        /**
         * Gets array of all "Topic" elements
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] getTopicArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(TOPIC$0, targetList);
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] result = new org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType getTopicArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPIC$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "Topic" element
         */
        public int sizeOfTopicArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(TOPIC$0);
            }
        }
        
        /**
         * Sets array of all "Topic" element
         */
        public void setTopicArray(org.activemq.ws.xmlbeans.notification.base.TopicExpressionType[] topicArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(topicArray, TOPIC$0);
            }
        }
        
        /**
         * Sets ith "Topic" element
         */
        public void setTopicArray(int i, org.activemq.ws.xmlbeans.notification.base.TopicExpressionType topic)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().find_element_user(TOPIC$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(topic);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType insertNewTopic(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().insert_element_user(TOPIC$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "Topic" element
         */
        public org.activemq.ws.xmlbeans.notification.base.TopicExpressionType addNewTopic()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.TopicExpressionType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.TopicExpressionType)get_store().add_element_user(TOPIC$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "Topic" element
         */
        public void removeTopic(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(TOPIC$0, i);
            }
        }
        
        /**
         * Gets the "FixedTopicSet" element
         */
        public boolean getFixedTopicSet()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FIXEDTOPICSET$2, 0);
                if (target == null)
                {
                    return false;
                }
                return target.getBooleanValue();
            }
        }
        
        /**
         * Gets (as xml) the "FixedTopicSet" element
         */
        public org.apache.xmlbeans.XmlBoolean xgetFixedTopicSet()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(FIXEDTOPICSET$2, 0);
                return target;
            }
        }
        
        /**
         * Sets the "FixedTopicSet" element
         */
        public void setFixedTopicSet(boolean fixedTopicSet)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(FIXEDTOPICSET$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(FIXEDTOPICSET$2);
                }
                target.setBooleanValue(fixedTopicSet);
            }
        }
        
        /**
         * Sets (as xml) the "FixedTopicSet" element
         */
        public void xsetFixedTopicSet(org.apache.xmlbeans.XmlBoolean fixedTopicSet)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(FIXEDTOPICSET$2, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlBoolean)get_store().add_element_user(FIXEDTOPICSET$2);
                }
                target.set(fixedTopicSet);
            }
        }
        
        /**
         * Gets array of all "TopicExpressionDialects" elements
         */
        public java.lang.String[] getTopicExpressionDialectsArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(TOPICEXPRESSIONDIALECTS$4, targetList);
                java.lang.String[] result = new java.lang.String[targetList.size()];
                for (int i = 0, len = targetList.size() ; i < len ; i++)
                    result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getStringValue();
                return result;
            }
        }
        
        /**
         * Gets ith "TopicExpressionDialects" element
         */
        public java.lang.String getTopicExpressionDialectsArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target.getStringValue();
            }
        }
        
        /**
         * Gets (as xml) array of all "TopicExpressionDialects" elements
         */
        public org.apache.xmlbeans.XmlAnyURI[] xgetTopicExpressionDialectsArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(TOPICEXPRESSIONDIALECTS$4, targetList);
                org.apache.xmlbeans.XmlAnyURI[] result = new org.apache.xmlbeans.XmlAnyURI[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets (as xml) ith "TopicExpressionDialects" element
         */
        public org.apache.xmlbeans.XmlAnyURI xgetTopicExpressionDialectsArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return (org.apache.xmlbeans.XmlAnyURI)target;
            }
        }
        
        /**
         * Returns number of "TopicExpressionDialects" element
         */
        public int sizeOfTopicExpressionDialectsArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(TOPICEXPRESSIONDIALECTS$4);
            }
        }
        
        /**
         * Sets array of all "TopicExpressionDialects" element
         */
        public void setTopicExpressionDialectsArray(java.lang.String[] topicExpressionDialectsArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(topicExpressionDialectsArray, TOPICEXPRESSIONDIALECTS$4);
            }
        }
        
        /**
         * Sets ith "TopicExpressionDialects" element
         */
        public void setTopicExpressionDialectsArray(int i, java.lang.String topicExpressionDialects)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.setStringValue(topicExpressionDialects);
            }
        }
        
        /**
         * Sets (as xml) array of all "TopicExpressionDialects" element
         */
        public void xsetTopicExpressionDialectsArray(org.apache.xmlbeans.XmlAnyURI[]topicExpressionDialectsArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(topicExpressionDialectsArray, TOPICEXPRESSIONDIALECTS$4);
            }
        }
        
        /**
         * Sets (as xml) ith "TopicExpressionDialects" element
         */
        public void xsetTopicExpressionDialectsArray(int i, org.apache.xmlbeans.XmlAnyURI topicExpressionDialects)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().find_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(topicExpressionDialects);
            }
        }
        
        /**
         * Inserts the value as the ith "TopicExpressionDialects" element
         */
        public void insertTopicExpressionDialects(int i, java.lang.String topicExpressionDialects)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = 
                    (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                target.setStringValue(topicExpressionDialects);
            }
        }
        
        /**
         * Appends the value as the last "TopicExpressionDialects" element
         */
        public void addTopicExpressionDialects(java.lang.String topicExpressionDialects)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TOPICEXPRESSIONDIALECTS$4);
                target.setStringValue(topicExpressionDialects);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "TopicExpressionDialects" element
         */
        public org.apache.xmlbeans.XmlAnyURI insertNewTopicExpressionDialects(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().insert_element_user(TOPICEXPRESSIONDIALECTS$4, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "TopicExpressionDialects" element
         */
        public org.apache.xmlbeans.XmlAnyURI addNewTopicExpressionDialects()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlAnyURI target = null;
                target = (org.apache.xmlbeans.XmlAnyURI)get_store().add_element_user(TOPICEXPRESSIONDIALECTS$4);
                return target;
            }
        }
        
        /**
         * Removes the ith "TopicExpressionDialects" element
         */
        public void removeTopicExpressionDialects(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(TOPICEXPRESSIONDIALECTS$4, i);
            }
        }
        
        /**
         * Gets the "RequiresRegistration" element
         */
        public boolean getRequiresRegistration()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REQUIRESREGISTRATION$6, 0);
                if (target == null)
                {
                    return false;
                }
                return target.getBooleanValue();
            }
        }
        
        /**
         * Gets (as xml) the "RequiresRegistration" element
         */
        public org.apache.xmlbeans.XmlBoolean xgetRequiresRegistration()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(REQUIRESREGISTRATION$6, 0);
                return target;
            }
        }
        
        /**
         * Sets the "RequiresRegistration" element
         */
        public void setRequiresRegistration(boolean requiresRegistration)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REQUIRESREGISTRATION$6, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REQUIRESREGISTRATION$6);
                }
                target.setBooleanValue(requiresRegistration);
            }
        }
        
        /**
         * Sets (as xml) the "RequiresRegistration" element
         */
        public void xsetRequiresRegistration(org.apache.xmlbeans.XmlBoolean requiresRegistration)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.XmlBoolean target = null;
                target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(REQUIRESREGISTRATION$6, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.XmlBoolean)get_store().add_element_user(REQUIRESREGISTRATION$6);
                }
                target.set(requiresRegistration);
            }
        }
    }
}
