/*
 * An XML document type.
 * Localname: FileControlFileList
 * Namespace: http://www.bea.com/wli/control/dynamicProperties
 * Java type: com.bea.wli.control.dynamicProperties.FileControlFileListDocument
 *
 * Automatically generated - do not modify.
 */
package com.bea.wli.control.dynamicProperties.impl;
/**
 * A document containing one FileControlFileList(@http://www.bea.com/wli/control/dynamicProperties) element.
 *
 * This is a complex type.
 */
public class FileControlFileListDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.control.dynamicProperties.FileControlFileListDocument
{
    
    public FileControlFileListDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName FILECONTROLFILELIST$0 = 
        new javax.xml.namespace.QName("http://www.bea.com/wli/control/dynamicProperties", "FileControlFileList");
    
    
    /**
     * Gets the "FileControlFileList" element
     */
    public com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList getFileControlFileList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList target = null;
            target = (com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList)get_store().find_element_user(FILECONTROLFILELIST$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "FileControlFileList" element
     */
    public void setFileControlFileList(com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList fileControlFileList)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList target = null;
            target = (com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList)get_store().find_element_user(FILECONTROLFILELIST$0, 0);
            if (target == null)
            {
                target = (com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList)get_store().add_element_user(FILECONTROLFILELIST$0);
            }
            target.set(fileControlFileList);
        }
    }
    
    /**
     * Appends and returns a new empty "FileControlFileList" element
     */
    public com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList addNewFileControlFileList()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList target = null;
            target = (com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList)get_store().add_element_user(FILECONTROLFILELIST$0);
            return target;
        }
    }
    /**
     * An XML FileControlFileList(@http://www.bea.com/wli/control/dynamicProperties).
     *
     * This is a complex type.
     */
    public static class FileControlFileListImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.control.dynamicProperties.FileControlFileListDocument.FileControlFileList
    {
        
        public FileControlFileListImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName FILELIST$0 = 
            new javax.xml.namespace.QName("http://www.bea.com/wli/control/dynamicProperties", "fileList");
        
        
        /**
         * Gets a List of "fileList" elements
         */
        public java.util.List<com.bea.wli.control.dynamicProperties.FileControlFileInfo> getFileListList()
        {
            final class FileListList extends java.util.AbstractList<com.bea.wli.control.dynamicProperties.FileControlFileInfo>
            {
                public com.bea.wli.control.dynamicProperties.FileControlFileInfo get(int i)
                    { return FileControlFileListImpl.this.getFileListArray(i); }
                
                public com.bea.wli.control.dynamicProperties.FileControlFileInfo set(int i, com.bea.wli.control.dynamicProperties.FileControlFileInfo o)
                {
                    com.bea.wli.control.dynamicProperties.FileControlFileInfo old = FileControlFileListImpl.this.getFileListArray(i);
                    FileControlFileListImpl.this.setFileListArray(i, o);
                    return old;
                }
                
                public void add(int i, com.bea.wli.control.dynamicProperties.FileControlFileInfo o)
                    { FileControlFileListImpl.this.insertNewFileList(i).set(o); }
                
                public com.bea.wli.control.dynamicProperties.FileControlFileInfo remove(int i)
                {
                    com.bea.wli.control.dynamicProperties.FileControlFileInfo old = FileControlFileListImpl.this.getFileListArray(i);
                    FileControlFileListImpl.this.removeFileList(i);
                    return old;
                }
                
                public int size()
                    { return FileControlFileListImpl.this.sizeOfFileListArray(); }
                
            }
            
            synchronized (monitor())
            {
                check_orphaned();
                return new FileListList();
            }
        }
        
        /**
         * Gets array of all "fileList" elements
         */
        public com.bea.wli.control.dynamicProperties.FileControlFileInfo[] getFileListArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                java.util.List targetList = new java.util.ArrayList();
                get_store().find_all_element_users(FILELIST$0, targetList);
                com.bea.wli.control.dynamicProperties.FileControlFileInfo[] result = new com.bea.wli.control.dynamicProperties.FileControlFileInfo[targetList.size()];
                targetList.toArray(result);
                return result;
            }
        }
        
        /**
         * Gets ith "fileList" element
         */
        public com.bea.wli.control.dynamicProperties.FileControlFileInfo getFileListArray(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.FileControlFileInfo target = null;
                target = (com.bea.wli.control.dynamicProperties.FileControlFileInfo)get_store().find_element_user(FILELIST$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                return target;
            }
        }
        
        /**
         * Returns number of "fileList" element
         */
        public int sizeOfFileListArray()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(FILELIST$0);
            }
        }
        
        /**
         * Sets array of all "fileList" element
         */
        public void setFileListArray(com.bea.wli.control.dynamicProperties.FileControlFileInfo[] fileListArray)
        {
            synchronized (monitor())
            {
                check_orphaned();
                arraySetterHelper(fileListArray, FILELIST$0);
            }
        }
        
        /**
         * Sets ith "fileList" element
         */
        public void setFileListArray(int i, com.bea.wli.control.dynamicProperties.FileControlFileInfo fileList)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.FileControlFileInfo target = null;
                target = (com.bea.wli.control.dynamicProperties.FileControlFileInfo)get_store().find_element_user(FILELIST$0, i);
                if (target == null)
                {
                    throw new IndexOutOfBoundsException();
                }
                target.set(fileList);
            }
        }
        
        /**
         * Inserts and returns a new empty value (as xml) as the ith "fileList" element
         */
        public com.bea.wli.control.dynamicProperties.FileControlFileInfo insertNewFileList(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.FileControlFileInfo target = null;
                target = (com.bea.wli.control.dynamicProperties.FileControlFileInfo)get_store().insert_element_user(FILELIST$0, i);
                return target;
            }
        }
        
        /**
         * Appends and returns a new empty value (as xml) as the last "fileList" element
         */
        public com.bea.wli.control.dynamicProperties.FileControlFileInfo addNewFileList()
        {
            synchronized (monitor())
            {
                check_orphaned();
                com.bea.wli.control.dynamicProperties.FileControlFileInfo target = null;
                target = (com.bea.wli.control.dynamicProperties.FileControlFileInfo)get_store().add_element_user(FILELIST$0);
                return target;
            }
        }
        
        /**
         * Removes the ith "fileList" element
         */
        public void removeFileList(int i)
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(FILELIST$0, i);
            }
        }
    }
}
