userManager.active
Class Active

java.lang.Object
  extended by userManager.active.Active
All Implemented Interfaces:
ActiveInterface

public class Active
extends Object
implements ActiveInterface


Method Summary
 String getFirstName(String username)
          Method will iterate Active users ArrayList, searches for a user that matchs the given username.
static Active getInstance()
          Method will return existing Active class.
 String getLastName(String username)
          Method will return Last name of the give username.
 ArrayList<String> getList()
          This method will return ArrayList of username of Users that are in the ActiveList.
 ArrayList<User> getUsers()
          This method will return ArrayList of User objects that are in the ActiveList.
 void insert(User user)
          Method will insert a user object into the Active ArrayList.
 void remove(String username)
          Method will remove a user from the Active table.
 int size()
          Method will return size of the Active ArrayList.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Active getInstance()
Method will return existing Active class. If no Active class exists, it will call the constructor, creates an instance and returns it to caller.

Returns:
Active will return instance of the Active class.

insert

public void insert(User user)
Method will insert a user object into the Active ArrayList.

Specified by:
insert in interface ActiveInterface
Parameters:
user - User Authenticated user object to be listed.

getFirstName

public String getFirstName(String username)
Method will iterate Active users ArrayList, searches for a user that matchs the given username. If found, method will return the first name.

Specified by:
getFirstName in interface ActiveInterface
Parameters:
username - username used to search for the user
Returns:
String First Name of user with the given username.

getLastName

public String getLastName(String username)
Method will return Last name of the give username. It will iterate Active users ArrayList, searches for a user that matchs the given username. If found, method will return the last name.

Specified by:
getLastName in interface ActiveInterface
Parameters:
username - username used to search for the user
Returns:
String Last Name of user with the given username.

remove

public void remove(String username)
Method will remove a user from the Active table. Method will iterate through the Active list searching for a user with the given username and if found will remove the object and decrement the count.

Specified by:
remove in interface ActiveInterface
Parameters:
username - of user to be removed from list.

size

public int size()
Method will return size of the Active ArrayList. Size reflects count of students that are currently online.

Specified by:
size in interface ActiveInterface

getUsers

public ArrayList<User> getUsers()
This method will return ArrayList of User objects that are in the ActiveList. List reflects users that are currently online.

Specified by:
getUsers in interface ActiveInterface
Returns:
ArrayList Current users online

getList

public ArrayList<String> getList()
This method will return ArrayList of username of Users that are in the ActiveList. List reflects usersnames that are currently online.

Specified by:
getList in interface ActiveInterface
Returns:
ArrayList Current users online