com.biocomfort.TO.user_parameters
Class ScaleUserTO

java.lang.Object
  extended by com.biocomfort.TO.user_parameters.ScaleUserTO
All Implemented Interfaces:
TO, java.lang.Cloneable

public class ScaleUserTO
extends java.lang.Object
implements TO, java.lang.Cloneable

The class ScaleUserTO is a data class to store the user information for a body diagnostic scale. It is part of the class ScaleUserParametersTO but initially not instantiated in case of using the standard constructor. To store user information for a ScaleUserParametersTO object create a new instance of this class and assign it to the ScaleUserParametersTO object.

See Also:
ScaleUserParametersTO

Field Summary
static int PHYSICAL_ACTIVITY_LEVEL_1
          Ease-of-use constant to describe the physical activity of a user.
static int PHYSICAL_ACTIVITY_LEVEL_2
          Ease-of-use constant to describe the physical activity of a user.
static int PHYSICAL_ACTIVITY_LEVEL_3
          Ease-of-use constant to describe the physical activity of a user.
static int PHYSICAL_ACTIVITY_UNKNOWN
          Ease-of-use constant to describe the physical activity of a user.
 
Constructor Summary
ScaleUserTO()
          Constructs a ScaleUserTO object with initializing it so that the gender is set to female, the date of birth is set to the standard base time (namely January 1, 1970, 00:00:00 GMT), the height is set to 180.0 cm, and the physical activity is set to ScaleUserTO.PHYSICAL_ACTIVITY_UNKNOWN.
 
Method Summary
 java.lang.Object clone()
          Returns a deep clone of this ScaleUserTO object.
 int getAge()
          Returns a number that represents the user's current age calculated for the default time zone and local.
 java.util.Date getDateOfBirth()
          Returns a Date object that represents the date of birth of a user.
 double getHeightInCentimeter()
          Returns the user's height.
 int getPhysicalActivity()
          Returns a numeric value that represents the user's physical activity.
 boolean isFemale()
          Returns true if the gender of this user is female.
 void setDateOfBirth(java.util.Date dateOfBirth)
          Sets the Date object that represents the date of birth of a user.
 void setFemale(boolean female)
          Sets the user's gender.
 void setHeightInCentimeter(double height)
          Sets the user's height.
 void setPhysicalActivity(int physicalActivity)
          Sets the user's physical activity described by a numeric value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PHYSICAL_ACTIVITY_UNKNOWN

public static final int PHYSICAL_ACTIVITY_UNKNOWN
Ease-of-use constant to describe the physical activity of a user. This constant is used to mark the user activity as unknown.

See Also:
setPhysicalActivity(int), getPhysicalActivity(), Constant Field Values

PHYSICAL_ACTIVITY_LEVEL_1

public static final int PHYSICAL_ACTIVITY_LEVEL_1
Ease-of-use constant to describe the physical activity of a user. The level 1 indicates no or only low physical activity.

See Also:
setPhysicalActivity(int), getPhysicalActivity(), Constant Field Values

PHYSICAL_ACTIVITY_LEVEL_2

public static final int PHYSICAL_ACTIVITY_LEVEL_2
Ease-of-use constant to describe the physical activity of a user. The level 1 indicates medium physical activity.

See Also:
setPhysicalActivity(int), getPhysicalActivity(), Constant Field Values

PHYSICAL_ACTIVITY_LEVEL_3

public static final int PHYSICAL_ACTIVITY_LEVEL_3
Ease-of-use constant to describe the physical activity of a user. The level 1 indicates intense physical activity.

See Also:
setPhysicalActivity(int), getPhysicalActivity(), Constant Field Values
Constructor Detail

ScaleUserTO

public ScaleUserTO()
Constructs a ScaleUserTO object with initializing it so that the gender is set to female, the date of birth is set to the standard base time (namely January 1, 1970, 00:00:00 GMT), the height is set to 180.0 cm, and the physical activity is set to ScaleUserTO.PHYSICAL_ACTIVITY_UNKNOWN.

Method Detail

getDateOfBirth

public java.util.Date getDateOfBirth()
Returns a Date object that represents the date of birth of a user.

Returns:
the user's date of birth

setDateOfBirth

public void setDateOfBirth(java.util.Date dateOfBirth)
Sets the Date object that represents the date of birth of a user.

Parameters:
dateOfBirth - the new user's date of birth

getAge

public int getAge()
Returns a number that represents the user's current age calculated for the default time zone and local.

Returns:
the current user'a age

isFemale

public boolean isFemale()
Returns true if the gender of this user is female.

Returns:
true if this user is female, false for male users

setFemale

public void setFemale(boolean female)
Sets the user's gender. If the given parameter female is true the user's gender is set to female, otherwise it is set to male.

Parameters:
female - true to sets the user's gender to female

getHeightInCentimeter

public double getHeightInCentimeter()
Returns the user's height. The unit of the value is cm.

Returns:
the user's height (in cm)

setHeightInCentimeter

public void setHeightInCentimeter(double height)
Sets the user's height. The unit of the value is cm. It is limited to values greater or equals than 50 cm and lower or equals than 255 cm.

Parameters:
height - the new user's height (in cm)

getPhysicalActivity

public int getPhysicalActivity()
Returns a numeric value that represents the user's physical activity.

Returns:
the user's physical activity
See Also:
PHYSICAL_ACTIVITY_UNKNOWN, PHYSICAL_ACTIVITY_LEVEL_1, PHYSICAL_ACTIVITY_LEVEL_2, PHYSICAL_ACTIVITY_LEVEL_3

setPhysicalActivity

public void setPhysicalActivity(int physicalActivity)
Sets the user's physical activity described by a numeric value.

Parameters:
physicalActivity - the new user's physical activity
See Also:
PHYSICAL_ACTIVITY_UNKNOWN, PHYSICAL_ACTIVITY_LEVEL_1, PHYSICAL_ACTIVITY_LEVEL_2, PHYSICAL_ACTIVITY_LEVEL_3

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a deep clone of this ScaleUserTO object.

Overrides:
clone in class java.lang.Object
Returns:
a deep clone of this instance
Throws:
java.lang.CloneNotSupportedException