org.locomotive.loco.perm
Class Group

java.lang.Object
  |
  +--org.locomotive.loco.perm.Group

public class Group
extends java.lang.Object
implements java.io.Serializable

Contains all the information for one group, which represents a set of users.

See Also:
Serialized Form

Constructor Summary
Group(java.lang.String groupName)
          Creates a group with associated with a name.
Group(java.lang.String groupName, int groupId, java.util.Vector groupUsers)
          Creates a group with complete group information.
 
Method Summary
 void addUser(java.lang.String userName)
          Adds a user to the group.
 boolean containsUser(java.lang.String userName)
          Checks for the existence of a user within this group.
 int getId()
          Returns the id of the group.
 java.lang.String getName()
          Returns the name of the group.
 java.util.Vector getUsers()
          Lists all the user names contained in the group.
 void removeUser(java.lang.String userName)
          Removes an existing user from the group.
 void setId(int groupId)
          Sets the id of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group(java.lang.String groupName)
Creates a group with associated with a name. This constructor is used before inserting a group into the database, which will assign it a unique id.
Parameters:
groupName - name of group to be created

Group

public Group(java.lang.String groupName,
             int groupId,
             java.util.Vector groupUsers)
Creates a group with complete group information. This constructor is used when the database is loading group information into the Group data structure.
Parameters:
groupName - name of group
groupId - id of group
groupUsers - Vector of user names contained in the group
Method Detail

getName

public java.lang.String getName()
Returns the name of the group.
Returns:
String name of the group

getId

public int getId()
Returns the id of the group.
Returns:
int id of the group

setId

public void setId(int groupId)
Sets the id of the group.
Parameters:
id - of the group

addUser

public void addUser(java.lang.String userName)
Adds a user to the group.
Parameters:
userName - name of user to be added to the group

removeUser

public void removeUser(java.lang.String userName)
Removes an existing user from the group.
Parameters:
userName - name of user to be removed from the group

getUsers

public java.util.Vector getUsers()
Lists all the user names contained in the group.
Returns:
Vector uf user names contained in the group

containsUser

public boolean containsUser(java.lang.String userName)
Checks for the existence of a user within this group.
Parameters:
userName - name of user in question
Returns:
true if the user is contained in this group