/*
 * XML Type:  assigneeType
 * Namespace: http://www.bea.com/wli/worklist/xml
 * Java type: com.bea.wli.worklist.xml.AssigneeType
 *
 * Automatically generated - do not modify.
 */
package com.bea.wli.worklist.xml.impl;
/**
 * An XML assigneeType(@http://www.bea.com/wli/worklist/xml).
 *
 * This is a complex type.
 */
public class AssigneeTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.bea.wli.worklist.xml.AssigneeType
{
    
    public AssigneeTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName USER$0 = 
        new javax.xml.namespace.QName("http://www.bea.com/wli/worklist/xml", "user");
    private static final javax.xml.namespace.QName GROUP$2 = 
        new javax.xml.namespace.QName("http://www.bea.com/wli/worklist/xml", "group");
    private static final javax.xml.namespace.QName ALGORITHM$4 = 
        new javax.xml.namespace.QName("http://www.bea.com/wli/worklist/xml", "algorithm");
    
    
    /**
     * Gets a List of "user" elements
     */
    public java.util.List<java.lang.String> getUserList()
    {
        final class UserList extends java.util.AbstractList<java.lang.String>
        {
            public java.lang.String get(int i)
                { return AssigneeTypeImpl.this.getUserArray(i); }
            
            public java.lang.String set(int i, java.lang.String o)
            {
                java.lang.String old = AssigneeTypeImpl.this.getUserArray(i);
                AssigneeTypeImpl.this.setUserArray(i, o);
                return old;
            }
            
            public void add(int i, java.lang.String o)
                { AssigneeTypeImpl.this.insertUser(i, o); }
            
            public java.lang.String remove(int i)
            {
                java.lang.String old = AssigneeTypeImpl.this.getUserArray(i);
                AssigneeTypeImpl.this.removeUser(i);
                return old;
            }
            
            public int size()
                { return AssigneeTypeImpl.this.sizeOfUserArray(); }
            
        }
        
        synchronized (monitor())
        {
            check_orphaned();
            return new UserList();
        }
    }
    
    /**
     * Gets array of all "user" elements
     */
    public java.lang.String[] getUserArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(USER$0, 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 "user" element
     */
    public java.lang.String getUserArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USER$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) a List of "user" elements
     */
    public java.util.List<org.apache.xmlbeans.XmlString> xgetUserList()
    {
        final class UserList extends java.util.AbstractList<org.apache.xmlbeans.XmlString>
        {
            public org.apache.xmlbeans.XmlString get(int i)
                { return AssigneeTypeImpl.this.xgetUserArray(i); }
            
            public org.apache.xmlbeans.XmlString set(int i, org.apache.xmlbeans.XmlString o)
            {
                org.apache.xmlbeans.XmlString old = AssigneeTypeImpl.this.xgetUserArray(i);
                AssigneeTypeImpl.this.xsetUserArray(i, o);
                return old;
            }
            
            public void add(int i, org.apache.xmlbeans.XmlString o)
                { AssigneeTypeImpl.this.insertNewUser(i).set(o); }
            
            public org.apache.xmlbeans.XmlString remove(int i)
            {
                org.apache.xmlbeans.XmlString old = AssigneeTypeImpl.this.xgetUserArray(i);
                AssigneeTypeImpl.this.removeUser(i);
                return old;
            }
            
            public int size()
                { return AssigneeTypeImpl.this.sizeOfUserArray(); }
            
        }
        
        synchronized (monitor())
        {
            check_orphaned();
            return new UserList();
        }
    }
    
    /**
     * Gets (as xml) array of all "user" elements
     */
    public org.apache.xmlbeans.XmlString[] xgetUserArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(USER$0, targetList);
            org.apache.xmlbeans.XmlString[] result = new org.apache.xmlbeans.XmlString[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets (as xml) ith "user" element
     */
    public org.apache.xmlbeans.XmlString xgetUserArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(USER$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return (org.apache.xmlbeans.XmlString)target;
        }
    }
    
    /**
     * Returns number of "user" element
     */
    public int sizeOfUserArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(USER$0);
        }
    }
    
    /**
     * Sets array of all "user" element
     */
    public void setUserArray(java.lang.String[] userArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(userArray, USER$0);
        }
    }
    
    /**
     * Sets ith "user" element
     */
    public void setUserArray(int i, java.lang.String user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USER$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.setStringValue(user);
        }
    }
    
    /**
     * Sets (as xml) array of all "user" element
     */
    public void xsetUserArray(org.apache.xmlbeans.XmlString[]userArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(userArray, USER$0);
        }
    }
    
    /**
     * Sets (as xml) ith "user" element
     */
    public void xsetUserArray(int i, org.apache.xmlbeans.XmlString user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(USER$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(user);
        }
    }
    
    /**
     * Inserts the value as the ith "user" element
     */
    public void insertUser(int i, java.lang.String user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = 
                (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(USER$0, i);
            target.setStringValue(user);
        }
    }
    
    /**
     * Appends the value as the last "user" element
     */
    public void addUser(java.lang.String user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(USER$0);
            target.setStringValue(user);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "user" element
     */
    public org.apache.xmlbeans.XmlString insertNewUser(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().insert_element_user(USER$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "user" element
     */
    public org.apache.xmlbeans.XmlString addNewUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(USER$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "user" element
     */
    public void removeUser(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(USER$0, i);
        }
    }
    
    /**
     * Gets a List of "group" elements
     */
    public java.util.List<java.lang.String> getGroupList()
    {
        final class GroupList extends java.util.AbstractList<java.lang.String>
        {
            public java.lang.String get(int i)
                { return AssigneeTypeImpl.this.getGroupArray(i); }
            
            public java.lang.String set(int i, java.lang.String o)
            {
                java.lang.String old = AssigneeTypeImpl.this.getGroupArray(i);
                AssigneeTypeImpl.this.setGroupArray(i, o);
                return old;
            }
            
            public void add(int i, java.lang.String o)
                { AssigneeTypeImpl.this.insertGroup(i, o); }
            
            public java.lang.String remove(int i)
            {
                java.lang.String old = AssigneeTypeImpl.this.getGroupArray(i);
                AssigneeTypeImpl.this.removeGroup(i);
                return old;
            }
            
            public int size()
                { return AssigneeTypeImpl.this.sizeOfGroupArray(); }
            
        }
        
        synchronized (monitor())
        {
            check_orphaned();
            return new GroupList();
        }
    }
    
    /**
     * Gets array of all "group" elements
     */
    public java.lang.String[] getGroupArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(GROUP$2, 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 "group" element
     */
    public java.lang.String getGroupArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(GROUP$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) a List of "group" elements
     */
    public java.util.List<org.apache.xmlbeans.XmlString> xgetGroupList()
    {
        final class GroupList extends java.util.AbstractList<org.apache.xmlbeans.XmlString>
        {
            public org.apache.xmlbeans.XmlString get(int i)
                { return AssigneeTypeImpl.this.xgetGroupArray(i); }
            
            public org.apache.xmlbeans.XmlString set(int i, org.apache.xmlbeans.XmlString o)
            {
                org.apache.xmlbeans.XmlString old = AssigneeTypeImpl.this.xgetGroupArray(i);
                AssigneeTypeImpl.this.xsetGroupArray(i, o);
                return old;
            }
            
            public void add(int i, org.apache.xmlbeans.XmlString o)
                { AssigneeTypeImpl.this.insertNewGroup(i).set(o); }
            
            public org.apache.xmlbeans.XmlString remove(int i)
            {
                org.apache.xmlbeans.XmlString old = AssigneeTypeImpl.this.xgetGroupArray(i);
                AssigneeTypeImpl.this.removeGroup(i);
                return old;
            }
            
            public int size()
                { return AssigneeTypeImpl.this.sizeOfGroupArray(); }
            
        }
        
        synchronized (monitor())
        {
            check_orphaned();
            return new GroupList();
        }
    }
    
    /**
     * Gets (as xml) array of all "group" elements
     */
    public org.apache.xmlbeans.XmlString[] xgetGroupArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(GROUP$2, targetList);
            org.apache.xmlbeans.XmlString[] result = new org.apache.xmlbeans.XmlString[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets (as xml) ith "group" element
     */
    public org.apache.xmlbeans.XmlString xgetGroupArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(GROUP$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return (org.apache.xmlbeans.XmlString)target;
        }
    }
    
    /**
     * Returns number of "group" element
     */
    public int sizeOfGroupArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(GROUP$2);
        }
    }
    
    /**
     * Sets array of all "group" element
     */
    public void setGroupArray(java.lang.String[] groupArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(groupArray, GROUP$2);
        }
    }
    
    /**
     * Sets ith "group" element
     */
    public void setGroupArray(int i, java.lang.String group)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(GROUP$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.setStringValue(group);
        }
    }
    
    /**
     * Sets (as xml) array of all "group" element
     */
    public void xsetGroupArray(org.apache.xmlbeans.XmlString[]groupArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(groupArray, GROUP$2);
        }
    }
    
    /**
     * Sets (as xml) ith "group" element
     */
    public void xsetGroupArray(int i, org.apache.xmlbeans.XmlString group)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(GROUP$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(group);
        }
    }
    
    /**
     * Inserts the value as the ith "group" element
     */
    public void insertGroup(int i, java.lang.String group)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = 
                (org.apache.xmlbeans.SimpleValue)get_store().insert_element_user(GROUP$2, i);
            target.setStringValue(group);
        }
    }
    
    /**
     * Appends the value as the last "group" element
     */
    public void addGroup(java.lang.String group)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(GROUP$2);
            target.setStringValue(group);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "group" element
     */
    public org.apache.xmlbeans.XmlString insertNewGroup(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().insert_element_user(GROUP$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "group" element
     */
    public org.apache.xmlbeans.XmlString addNewGroup()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(GROUP$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "group" element
     */
    public void removeGroup(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(GROUP$2, i);
        }
    }
    
    /**
     * Gets the "algorithm" element
     */
    public com.bea.wli.worklist.xml.AlgorithmType.Enum getAlgorithm()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ALGORITHM$4, 0);
            if (target == null)
            {
                return null;
            }
            return (com.bea.wli.worklist.xml.AlgorithmType.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "algorithm" element
     */
    public com.bea.wli.worklist.xml.AlgorithmType xgetAlgorithm()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.worklist.xml.AlgorithmType target = null;
            target = (com.bea.wli.worklist.xml.AlgorithmType)get_store().find_element_user(ALGORITHM$4, 0);
            return target;
        }
    }
    
    /**
     * True if has "algorithm" element
     */
    public boolean isSetAlgorithm()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ALGORITHM$4) != 0;
        }
    }
    
    /**
     * Sets the "algorithm" element
     */
    public void setAlgorithm(com.bea.wli.worklist.xml.AlgorithmType.Enum algorithm)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ALGORITHM$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ALGORITHM$4);
            }
            target.setEnumValue(algorithm);
        }
    }
    
    /**
     * Sets (as xml) the "algorithm" element
     */
    public void xsetAlgorithm(com.bea.wli.worklist.xml.AlgorithmType algorithm)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.bea.wli.worklist.xml.AlgorithmType target = null;
            target = (com.bea.wli.worklist.xml.AlgorithmType)get_store().find_element_user(ALGORITHM$4, 0);
            if (target == null)
            {
                target = (com.bea.wli.worklist.xml.AlgorithmType)get_store().add_element_user(ALGORITHM$4);
            }
            target.set(algorithm);
        }
    }
    
    /**
     * Unsets the "algorithm" element
     */
    public void unsetAlgorithm()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ALGORITHM$4, 0);
        }
    }
}
