sharpster.daemon.groupmanagement
Class GroupClass

java.lang.Object
  |
  +--sharpster.daemon.groupmanagement.GroupClass

public class GroupClass
extends java.lang.Object


Constructor Summary
GroupClass()
          Creates the class and initialize the user list.
 
Method Summary
 boolean addUser(java.lang.String user)
          Adds a given user to the group.
 java.lang.String getName()
          Gets the group's name.
 java.util.LinkedList getUsers()
          Returns a list containing the users in the group.
 boolean isUserInGroup(java.lang.String user)
          Checks if a given user is a memeber of the group.
 boolean removeUser(java.lang.String user)
          Removes a given user from the group.
 void setName(java.lang.String name)
          Sets the group's name.
 java.lang.String toString()
          Returns a, somewhat, nice string-representation of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupClass

public GroupClass()
Creates the class and initialize the user list.

Method Detail

setName

public void setName(java.lang.String name)
Sets the group's name.

Parameters:
name - The name that is to be assigned to the group.

getName

public java.lang.String getName()
Gets the group's name.

Returns:
The name of the group.

toString

public java.lang.String toString()
Returns a, somewhat, nice string-representation of the group.

Overrides:
toString in class java.lang.Object
Returns:
The group name and its users.

isUserInGroup

public boolean isUserInGroup(java.lang.String user)
Checks if a given user is a memeber of the group.

Parameters:
user - A username.
Returns:
True if user is in the group, otherwise false.

removeUser

public boolean removeUser(java.lang.String user)
Removes a given user from the group.

Parameters:
user - A username.
Returns:
True if user was removed from the group, otherwise false.

addUser

public boolean addUser(java.lang.String user)
Adds a given user to the group.

Returns:
True if user was added to the group, otherwise false.

getUsers

public java.util.LinkedList getUsers()
Returns a list containing the users in the group.

Returns:
A list containing all the users in the group.