AHA
Class UserModel

java.lang.Object
  |
  +--AHA.UserModel

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

UserModel represents the user model and maintains a permanent version in the user's user model file and logfile.

See Also:
Serialized Form

Constructor Summary
UserModel()
          The default constructor is forbidden.
UserModel(AHA AHA)
          This is the "short" constructor, with one parameter: the AHA context.
UserModel(AHA AHA, java.lang.String ModelName)
           
 
Method Summary
 java.awt.Color getActiveLinkColor()
          Return the color for active links (being clicked on).
 java.awt.Color getBadLinkColor()
          Return the color for undesired links.
 java.awt.Color getColor(java.lang.String color)
           
 java.lang.String getDepartment()
          Return the user's department.
 java.lang.String getEmail()
          Return the user's email address.
 java.awt.Color getExternalLinkColor()
          Return the color for external unvisited links.
 java.awt.Color getExternalVisitedColor()
          Return the color for external visited links.
 java.awt.Color getGoodLinkColor()
          Return the color for desired links.
 java.lang.String getId()
          Return the user's id.
 java.lang.String getInstitute()
          Return the user's institute.
 java.util.Hashtable getKnowledge()
          Return the internal representation of the user's knowledge.
 java.util.Vector getLogFileLines()
          Return the lines of the user's log file as a vector.
 java.lang.String getName()
          Return the user's name.
 int getNbBadVisited()
           
 int getNbGoodVisited()
           
 int getNbNotVisited()
           
 int getNbPages()
          Return the number of pages to read.
 int getNbRead()
          Return the number of read pages.
 java.awt.Color getNeutralLinkColor()
          Return the color for uninteresting (previously visited) links.
 java.lang.String getPasswd()
          Return the user's password.
 java.util.Hashtable getVisitedList()
          Return the internal representation of the pages with their visited status
 boolean hasBadVisit(java.lang.String name)
           
 boolean hasGoodVisit(java.lang.String name)
           
 boolean hasNotVisit(java.lang.String name)
           
 org.w3c.dom.Element makeEl(com.sun.xml.tree.XmlDocument d, java.lang.String name, java.lang.String value)
           
 void print(java.lang.Object s)
           
 java.lang.String printActiveLinkColor()
          Return the hexadecimal representation of the color for active links (being clicked on).
 java.lang.String printBadLinkColor()
          Return the hexadecimal representation of the color for undesired links.
static java.lang.String printColor(java.awt.Color c)
          Return a String representation of a Color.
 java.lang.String printExternalLinkColor()
          Return the hexadecimal representation of the color for external unvisited links.
 java.lang.String printExternalVisitedColor()
          Return the hexadecimal representation of the color for external visited links.
 java.lang.String printGoodLinkColor()
          Return the hexadecimal representation of the color for desired links.
 void println(java.lang.Object s)
           
 java.lang.String printNeutralLinkColor()
          Return the hexadecimal representation of the color for uninteresting (previously visited) links.
 void recount()
           
 void saveUserModel(java.lang.String ModelName)
          This method rewrites the User Model file and appends to the log file.
 void setActiveLinkColor(java.awt.Color c)
          Set the color for active links (being clicked on).
 void setBadLinkColor(java.awt.Color c)
          Set the color for undesired links.
 void setDepartment(java.lang.String s)
          Set the user's department.
 void setEmail(java.lang.String s)
          Set the user's email address.
 void setExternalLinkColor(java.awt.Color c)
          Set the color for external unvisited links.
 void setExternalVisitedColor(java.awt.Color c)
          Set the color for external visited links.
 void setGoodLinkColor(java.awt.Color c)
          Set the color for desired links.
 void setId(java.lang.String s)
          Set the user's id.
 void setInstitute(java.lang.String s)
          Set the user's institute.
 void setKnowledge(java.util.Hashtable t)
          Replace the user's knowledge by the argument of the method call.
 void setLogFileLines(java.util.Vector v)
          Replace the user's vector representation of the log file by the argument of the method call.
 void setName(java.lang.String s)
          Set the user's name.
 void setNbPages(int n)
          Set the number of pages to read.
 void setNbRead(int n)
          Set the number of read pages.
 void setNeutralLinkColor(java.awt.Color c)
          Set the color for uninteresting (previously visited) links.
 void setPasswd(java.lang.String s)
          Set the user's password.
 void setVisitedList(java.util.Hashtable hs)
          Replace the user's pages with visited status
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserModel

public UserModel()
          throws AhaException
The default constructor is forbidden.
Throws:
AhaException - Always thrown because this constructor is not valid.

UserModel

public UserModel(AHA AHA)
This is the "short" constructor, with one parameter: the AHA context.

UserModel

public UserModel(AHA AHA,
                 java.lang.String ModelName)
          throws AhaException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print

public void print(java.lang.Object s)

println

public void println(java.lang.Object s)

getColor

public java.awt.Color getColor(java.lang.String color)

makeEl

public org.w3c.dom.Element makeEl(com.sun.xml.tree.XmlDocument d,
                                  java.lang.String name,
                                  java.lang.String value)

saveUserModel

public void saveUserModel(java.lang.String ModelName)
                   throws AhaException
This method rewrites the User Model file and appends to the log file. The ModelName is supposed to be a unique object for this name, because it is used for synchronization between threads. The ModelName is supposed to be a unique object for this name, because it is used for synchronization between threads.
Throws:
AhaException - If the user model cannot be saved or the log file cannot be appended to.

getKnowledge

public java.util.Hashtable getKnowledge()
Return the internal representation of the user's knowledge.

setKnowledge

public void setKnowledge(java.util.Hashtable t)
Replace the user's knowledge by the argument of the method call.

getVisitedList

public java.util.Hashtable getVisitedList()
Return the internal representation of the pages with their visited status

setVisitedList

public void setVisitedList(java.util.Hashtable hs)
Replace the user's pages with visited status

getLogFileLines

public java.util.Vector getLogFileLines()
Return the lines of the user's log file as a vector.

setLogFileLines

public void setLogFileLines(java.util.Vector v)
Replace the user's vector representation of the log file by the argument of the method call.

printColor

public static java.lang.String printColor(java.awt.Color c)
Return a String representation of a Color. The String has the hexadecimal pattern required for color representations in HTML.

getGoodLinkColor

public java.awt.Color getGoodLinkColor()
Return the color for desired links.

printGoodLinkColor

public java.lang.String printGoodLinkColor()
Return the hexadecimal representation of the color for desired links.

setGoodLinkColor

public void setGoodLinkColor(java.awt.Color c)
Set the color for desired links.

getBadLinkColor

public java.awt.Color getBadLinkColor()
Return the color for undesired links.

printBadLinkColor

public java.lang.String printBadLinkColor()
Return the hexadecimal representation of the color for undesired links.

setBadLinkColor

public void setBadLinkColor(java.awt.Color c)
Set the color for undesired links.

getActiveLinkColor

public java.awt.Color getActiveLinkColor()
Return the color for active links (being clicked on).

printActiveLinkColor

public java.lang.String printActiveLinkColor()
Return the hexadecimal representation of the color for active links (being clicked on).

setActiveLinkColor

public void setActiveLinkColor(java.awt.Color c)
Set the color for active links (being clicked on).

getNeutralLinkColor

public java.awt.Color getNeutralLinkColor()
Return the color for uninteresting (previously visited) links.

printNeutralLinkColor

public java.lang.String printNeutralLinkColor()
Return the hexadecimal representation of the color for uninteresting (previously visited) links.

setNeutralLinkColor

public void setNeutralLinkColor(java.awt.Color c)
Set the color for uninteresting (previously visited) links.

getExternalLinkColor

public java.awt.Color getExternalLinkColor()
Return the color for external unvisited links.

printExternalLinkColor

public java.lang.String printExternalLinkColor()
Return the hexadecimal representation of the color for external unvisited links.

setExternalLinkColor

public void setExternalLinkColor(java.awt.Color c)
Set the color for external unvisited links.

getExternalVisitedColor

public java.awt.Color getExternalVisitedColor()
Return the color for external visited links.

printExternalVisitedColor

public java.lang.String printExternalVisitedColor()
Return the hexadecimal representation of the color for external visited links.

setExternalVisitedColor

public void setExternalVisitedColor(java.awt.Color c)
Set the color for external visited links.

getName

public java.lang.String getName()
Return the user's name.

setName

public void setName(java.lang.String s)
Set the user's name.

getEmail

public java.lang.String getEmail()
Return the user's email address.

setEmail

public void setEmail(java.lang.String s)
Set the user's email address.

getId

public java.lang.String getId()
Return the user's id.

setId

public void setId(java.lang.String s)
Set the user's id.

getPasswd

public java.lang.String getPasswd()
Return the user's password.

setPasswd

public void setPasswd(java.lang.String s)
Set the user's password.

getInstitute

public java.lang.String getInstitute()
Return the user's institute.

setInstitute

public void setInstitute(java.lang.String s)
Set the user's institute.

getDepartment

public java.lang.String getDepartment()
Return the user's department.

setDepartment

public void setDepartment(java.lang.String s)
Set the user's department.

getNbRead

public int getNbRead()
Return the number of read pages.

setNbRead

public void setNbRead(int n)
Set the number of read pages.

getNbPages

public int getNbPages()
Return the number of pages to read.

recount

public void recount()

setNbPages

public void setNbPages(int n)
Set the number of pages to read.

getNbNotVisited

public int getNbNotVisited()

getNbBadVisited

public int getNbBadVisited()

getNbGoodVisited

public int getNbGoodVisited()

hasNotVisit

public boolean hasNotVisit(java.lang.String name)

hasBadVisit

public boolean hasBadVisit(java.lang.String name)

hasGoodVisit

public boolean hasGoodVisit(java.lang.String name)