/*
 * An XML document type.
 * Localname: Notify
 * Namespace: http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd
 * Java type: org.activemq.ws.xmlbeans.notification.base.NotifyDocument
 *
 * Automatically generated - do not modify.
 */
package org.activemq.ws.xmlbeans.notification.base.impl;
/**
 * A document containing one Notify(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd) element.
 *
 * This is a complex type.
 */
public class NotifyDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.NotifyDocument
{
    
    public NotifyDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName NOTIFY$0 = 
        new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Notify");
    
    
    /**
     * Gets the "Notify" element
     */
    public org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify getNotify()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify)get_store().find_element_user(NOTIFY$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Notify" element
     */
    public void setNotify(org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify notify)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify)get_store().find_element_user(NOTIFY$0, 0);
            if (target == null)
            {
                target = (org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify)get_store().add_element_user(NOTIFY$0);
            }
            target.set(notify);
        }
    }
    
    /**
     * Appends and returns a new empty "Notify" element
     */
    public org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify addNewNotify()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify target = null;
            target = (org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify)get_store().add_element_user(NOTIFY$0);
            return target;
        }
    }
    /**
     * An XML Notify(@http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd).
     *
     * This is a complex type.
     */
    public static class NotifyImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements org.activemq.ws.xmlbeans.notification.base.NotifyDocument.Notify
    {
        
        public NotifyImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName NOTIFICATIONMESSAGE$0 = 
            new javax.xml.namespace.QName("http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "NotificationMessage");
        
        
        /**
         * Gets array of all "NotificationMessage" elements
         */
        public org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType[] getNotificationMessageArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(NOTIFICATIONMESSAGE$0, targetList);
                org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType[] result = new org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "NotificationMessage" element
         */
        public org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType getNotificationMessageArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType)get_store().find_element_user(NOTIFICATIONMESSAGE$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "NotificationMessage" element
         */
        public int sizeOfNotificationMessageArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(NOTIFICATIONMESSAGE$0);
            }
        }
        
        /**
         * Sets array of all "NotificationMessage" element
         */
        public void setNotificationMessageArray(org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType[] notificationMessageArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(notificationMessageArray, NOTIFICATIONMESSAGE$0);
            }
        }
        
        /**
         * Sets ith "NotificationMessage" element
         */
        public void setNotificationMessageArray(int i, org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType notificationMessage)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType)get_store().find_element_user(NOTIFICATIONMESSAGE$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(notificationMessage);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "NotificationMessage" element
         */
        public org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType insertNewNotificationMessage(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType)get_store().insert_element_user(NOTIFICATIONMESSAGE$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "NotificationMessage" element
         */
        public org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType addNewNotificationMessage()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType target = null;
                target = (org.activemq.ws.xmlbeans.notification.base.NotificationMessageHolderType)get_store().add_element_user(NOTIFICATIONMESSAGE$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "NotificationMessage" element
         */
        public void removeNotificationMessage(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(NOTIFICATIONMESSAGE$0, i);
            }
        }
    }
}
