Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.application.timewarp.utilities
Class User  view User download User.java

java.lang.Object
  extended byorg.scopemvc.application.timewarp.utilities.User

public class User
extends java.lang.Object

Keeps track of the user data, specifically the user's name, company, and e-mail address.

Version:
1.0

Field Summary
private  java.lang.String company
           
private  java.lang.String eMail
           
private  java.lang.String name
           
private static User user
           
 
Constructor Summary
private User()
          Private constructor for the User object to ensure that the object is a singleton.
private User(java.lang.String inName, java.lang.String inEMail, java.lang.String inCompany)
          Private constructor for the User object to ensure that the object is a singleton.
 
Method Summary
static void createInstance()
          Create an instance of the User object.
static void createInstance(java.lang.String inName, java.lang.String inEMail, java.lang.String inCompany)
          Create an instance of the User object.
 java.lang.String getCompany()
          Gets the company attribute of the User object.
private  void getDataFromPrefs()
          Pulls the users data from the preferences.
 java.lang.String getEMail()
          Gets the eMail attribute of the User object.
 java.lang.String getFirstName()
          Gets the user's first name as parsed out from the whole name.
static User getInstance()
          Gets the instance of the User class.
 java.lang.String getName()
          Gets the name attribute of the User object.
private  void setCompany(java.lang.String inCompany)
          Sets the company attribute of the User object.
private  void setEMail(java.lang.String inEMail)
          Sets the eMail attribute of the User object
private  void setName(java.lang.String inName)
          Sets the name attribute of the User object.
private  void writeDataToPrefs()
          Writes the name and e-mail address of the user to the preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

private static User user

eMail

private java.lang.String eMail

name

private java.lang.String name

company

private java.lang.String company
Constructor Detail

User

private User()
Private constructor for the User object to ensure that the object is a singleton. If the user's data is not already on the disk the name and e-mail will be set to "".


User

private User(java.lang.String inName,
             java.lang.String inEMail,
             java.lang.String inCompany)
Private constructor for the User object to ensure that the object is a singleton.

Method Detail

getInstance

public static User getInstance()
Gets the instance of the User class.


createInstance

public static void createInstance(java.lang.String inName,
                                  java.lang.String inEMail,
                                  java.lang.String inCompany)
Create an instance of the User object. This method should be called when the user changes their name or their e-mail address.


createInstance

public static void createInstance()
Create an instance of the User object. This method should be called when the appliation is started.


getCompany

public java.lang.String getCompany()
Gets the company attribute of the User object.


getName

public java.lang.String getName()
Gets the name attribute of the User object.


getFirstName

public java.lang.String getFirstName()
Gets the user's first name as parsed out from the whole name.


getEMail

public java.lang.String getEMail()
Gets the eMail attribute of the User object.


getDataFromPrefs

private void getDataFromPrefs()
Pulls the users data from the preferences. If there is no name in the prefs the name attribute will be set to "", if there is no e-mail address in the file, the eMail attribute will be set to "".


setCompany

private void setCompany(java.lang.String inCompany)
Sets the company attribute of the User object.


setName

private void setName(java.lang.String inName)
Sets the name attribute of the User object.


setEMail

private void setEMail(java.lang.String inEMail)
Sets the eMail attribute of the User object


writeDataToPrefs

private void writeDataToPrefs()
Writes the name and e-mail address of the user to the preferences.