synchronized with last schema revision.
[vamsas.git] / src / org / vamsas / objects / core / Application.java
index 1b2659c..9ab0c04 100644 (file)
@@ -15,6 +15,8 @@ import java.io.IOException;
 import java.io.Reader;
 import java.io.Serializable;
 import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Vector;
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.Unmarshaller;
@@ -46,15 +48,20 @@ implements java.io.Serializable
     private java.lang.String _name;
 
     /**
-     * Field _session
+     * Field _urn
      */
-    private java.lang.String _session;
+    private java.lang.String _urn;
 
     /**
      * Field _data
      */
     private java.lang.String _data;
 
+    /**
+     * Field _userList
+     */
+    private java.util.Vector _userList;
+
 
       //----------------/
      //- Constructors -/
@@ -63,6 +70,7 @@ implements java.io.Serializable
     public Application() 
      {
         super();
+        _userList = new Vector();
     } //-- org.vamsas.objects.core.Application()
 
 
@@ -71,6 +79,45 @@ implements java.io.Serializable
     //-----------/
 
     /**
+     * Method addUser
+     * 
+     * 
+     * 
+     * @param vUser
+     */
+    public void addUser(org.vamsas.objects.core.User vUser)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        _userList.addElement(vUser);
+    } //-- void addUser(org.vamsas.objects.core.User) 
+
+    /**
+     * Method addUser
+     * 
+     * 
+     * 
+     * @param index
+     * @param vUser
+     */
+    public void addUser(int index, org.vamsas.objects.core.User vUser)
+        throws java.lang.IndexOutOfBoundsException
+    {
+        _userList.insertElementAt(vUser, index);
+    } //-- void addUser(int, org.vamsas.objects.core.User) 
+
+    /**
+     * Method enumerateUser
+     * 
+     * 
+     * 
+     * @return Enumeration
+     */
+    public java.util.Enumeration enumerateUser()
+    {
+        return _userList.elements();
+    } //-- java.util.Enumeration enumerateUser() 
+
+    /**
      * Note: hashCode() has not been overriden
      * 
      * @param obj
@@ -101,12 +148,12 @@ implements java.io.Serializable
             }
             else if (temp._name != null)
                 return false;
-            if (this._session != null) {
-                if (temp._session == null) return false;
-                else if (!(this._session.equals(temp._session))) 
+            if (this._urn != null) {
+                if (temp._urn == null) return false;
+                else if (!(this._urn.equals(temp._urn))) 
                     return false;
             }
-            else if (temp._session != null)
+            else if (temp._urn != null)
                 return false;
             if (this._data != null) {
                 if (temp._data == null) return false;
@@ -115,6 +162,13 @@ implements java.io.Serializable
             }
             else if (temp._data != null)
                 return false;
+            if (this._userList != null) {
+                if (temp._userList == null) return false;
+                else if (!(this._userList.equals(temp._userList))) 
+                    return false;
+            }
+            else if (temp._userList != null)
+                return false;
             return true;
         }
         return false;
@@ -143,15 +197,63 @@ implements java.io.Serializable
     } //-- java.lang.String getName() 
 
     /**
-     * Returns the value of field 'session'.
+     * Returns the value of field 'urn'.
      * 
      * @return String
-     * @return the value of field 'session'.
+     * @return the value of field 'urn'.
+     */
+    public java.lang.String getUrn()
+    {
+        return this._urn;
+    } //-- java.lang.String getUrn() 
+
+    /**
+     * Method getUser
+     * 
+     * 
+     * 
+     * @param index
+     * @return User
      */
-    public java.lang.String getSession()
+    public org.vamsas.objects.core.User getUser(int index)
+        throws java.lang.IndexOutOfBoundsException
     {
-        return this._session;
-    } //-- java.lang.String getSession() 
+        //-- check bounds for index
+        if ((index < 0) || (index > _userList.size())) {
+            throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
+        }
+        
+        return (org.vamsas.objects.core.User) _userList.elementAt(index);
+    } //-- org.vamsas.objects.core.User getUser(int) 
+
+    /**
+     * Method getUser
+     * 
+     * 
+     * 
+     * @return User
+     */
+    public org.vamsas.objects.core.User[] getUser()
+    {
+        int size = _userList.size();
+        org.vamsas.objects.core.User[] mArray = new org.vamsas.objects.core.User[size];
+        for (int index = 0; index < size; index++) {
+            mArray[index] = (org.vamsas.objects.core.User) _userList.elementAt(index);
+        }
+        return mArray;
+    } //-- org.vamsas.objects.core.User[] getUser() 
+
+    /**
+     * Method getUserCount
+     * 
+     * 
+     * 
+     * @return int
+     */
+    public int getUserCount()
+    {
+        return _userList.size();
+    } //-- int getUserCount() 
 
     /**
      * Returns the value of field 'version'.
@@ -211,6 +313,30 @@ implements java.io.Serializable
     } //-- void marshal(org.xml.sax.ContentHandler) 
 
     /**
+     * Method removeAllUser
+     * 
+     */
+    public void removeAllUser()
+    {
+        _userList.removeAllElements();
+    } //-- void removeAllUser() 
+
+    /**
+     * Method removeUser
+     * 
+     * 
+     * 
+     * @param index
+     * @return User
+     */
+    public org.vamsas.objects.core.User removeUser(int index)
+    {
+        java.lang.Object obj = _userList.elementAt(index);
+        _userList.removeElementAt(index);
+        return (org.vamsas.objects.core.User) obj;
+    } //-- org.vamsas.objects.core.User removeUser(int) 
+
+    /**
      * Sets the value of field 'data'.
      * 
      * @param data the value of field 'data'.
@@ -231,14 +357,48 @@ implements java.io.Serializable
     } //-- void setName(java.lang.String) 
 
     /**
-     * Sets the value of field 'session'.
+     * Sets the value of field 'urn'.
+     * 
+     * @param urn the value of field 'urn'.
+     */
+    public void setUrn(java.lang.String urn)
+    {
+        this._urn = urn;
+    } //-- void setUrn(java.lang.String) 
+
+    /**
+     * Method setUser
+     * 
+     * 
      * 
-     * @param session the value of field 'session'.
+     * @param index
+     * @param vUser
      */
-    public void setSession(java.lang.String session)
+    public void setUser(int index, org.vamsas.objects.core.User vUser)
+        throws java.lang.IndexOutOfBoundsException
     {
-        this._session = session;
-    } //-- void setSession(java.lang.String) 
+        //-- check bounds for index
+        if ((index < 0) || (index > _userList.size())) {
+            throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]");
+        }
+        _userList.setElementAt(vUser, index);
+    } //-- void setUser(int, org.vamsas.objects.core.User) 
+
+    /**
+     * Method setUser
+     * 
+     * 
+     * 
+     * @param userArray
+     */
+    public void setUser(org.vamsas.objects.core.User[] userArray)
+    {
+        //-- copy array
+        _userList.removeAllElements();
+        for (int i = 0; i < userArray.length; i++) {
+            _userList.addElement(userArray[i]);
+        }
+    } //-- void setUser(org.vamsas.objects.core.User) 
 
     /**
      * Sets the value of field 'version'.