|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.spaz.cron.user.impl.CRONUser
public class CRONUser
A CRONOMETER-specific, property-based User
implementation.
Nested Class Summary | |
---|---|
static class |
CRONUser.UserPropertyValidator
A simple validator for user properties. |
Method Summary | |
---|---|
void |
addUserChangeListener(UserChangeListener l)
Add a listener for user change events. |
void |
addUserMetrics(java.util.Date date,
UserMetrics metrics)
Add a new set of metrics for a particular date. |
void |
addUserMetrics(UserMetrics metrics)
Add a new set of metrics for the current time. |
boolean |
firstRun()
|
java.lang.Integer |
getAge()
Get the user's age |
java.util.Date |
getBirthDate()
Get the user's birthdate |
java.lang.Double |
getHeightInCM()
Get the user's height in cm |
java.lang.String |
getName()
Get the name of the user. |
Target |
getTarget(NutrientInfo nutrient)
Get the target value for a particular nutrient. |
static User |
getUser()
|
java.util.List |
getUserMetrics()
Get a List of all user metrics. |
java.util.List |
getUserMetrics(java.util.Date date)
Get a List of all user metrics for a given day. |
java.lang.String |
getUserPreference(java.lang.String prefName)
This gets a user preference by name. |
boolean |
isFemale()
Get the gender of the user. |
boolean |
isMale()
Get the gender of the user. |
protected void |
notifyListeners()
|
void |
removeUserChangeListener(UserChangeListener l)
Remove a listener for user change events. |
void |
removeUserMetrics(UserMetrics metrics)
Remove a set of user metrics from the database. |
void |
setBirthDate(java.util.Date date)
Set the user's birthdate |
void |
setFirstRun(boolean val)
|
void |
setGender(boolean male)
Set the gender of the user |
void |
setHeightInCM(java.lang.Double height)
Set the user's height in cm |
void |
setName(java.lang.String name)
Set the name of the user |
void |
setTarget(NutrientInfo nutrient,
Target target)
Set a target value for a particular NutrientInfo. |
void |
setUserPreference(java.lang.String prefName,
java.lang.String value)
Sets the value of a user preference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final User getUser()
public java.lang.String getName()
User
getName
in interface User
public void setName(java.lang.String name)
User
setName
in interface User
public java.util.Date getBirthDate()
User
getBirthDate
in interface User
public void setBirthDate(java.util.Date date)
User
setBirthDate
in interface User
public java.lang.Integer getAge()
User
getAge
in interface User
public java.lang.Double getHeightInCM()
User
getHeightInCM
in interface User
public void setHeightInCM(java.lang.Double height)
User
setHeightInCM
in interface User
public java.lang.String getUserPreference(java.lang.String prefName)
User
getUserPreference
in interface User
prefName
- the ID of the preference.
public void setUserPreference(java.lang.String prefName, java.lang.String value)
User
CRONConfiguration
. In the case where
the value is not legal, this method will silently fail.
setUserPreference
in interface User
prefName
- Tne ID of the preference.value
- The new value for the preference.public java.util.List getUserMetrics()
User
List
of all user metrics. These are the values that the user
is tracking.
getUserMetrics
in interface User
List
containing UserMetrics
objects for each
date the user has a metric for.public java.util.List getUserMetrics(java.util.Date date)
User
List
of all user metrics for a given day. The day in the
Date
provided will be used to select them.
getUserMetrics
in interface User
date
- The date to search for metrics from.
public void addUserMetrics(java.util.Date date, UserMetrics metrics)
User
addUserMetrics
in interface User
public void addUserMetrics(UserMetrics metrics)
User
addUserMetrics
in interface User
public void removeUserMetrics(UserMetrics metrics)
User
removeUserMetrics
in interface User
public void setTarget(NutrientInfo nutrient, Target target)
User
setTarget
in interface User
public Target getTarget(NutrientInfo nutrient)
User
getTarget
in interface User
public final void addUserChangeListener(UserChangeListener l)
User
addUserChangeListener
in interface User
l
- the listener.protected final void notifyListeners()
public final void removeUserChangeListener(UserChangeListener l)
User
removeUserChangeListener
in interface User
l
- the listener.public boolean isMale()
User
isMale
in interface User
public boolean isFemale()
User
isFemale
in interface User
public void setGender(boolean male)
User
setGender
in interface User
male
- true
if the user is male, false
otherwise.public boolean firstRun()
public void setFirstRun(boolean val)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |