@@ -0,0 +1,2727 @@
+/*%0A * Copyright (c) 2014 Personal-Health-Monitoring-System%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * %09http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.cse3310.phms.model;%0A%0Aimport com.activeandroid.Model;%0Aimport com.activeandroid.annotation.Column;%0Aimport com.activeandroid.annotation.Table;%0Aimport com.cse3310.phms.ui.utils.UserSingleton;%0A%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.Locale;%0Aimport java.util.TimeZone;%0A%0A@Table(name = %22WeightLog%22)%0Apublic class WeightLog extends Model%7B%0A    @Column private double weight;%0A    @Column private User user;%0A    @Column private long time;%0A    private Date date;%0A%0A    private SimpleDateFormat dateFormat = new SimpleDateFormat(%22MMMM d,yyyy%22, Locale.ENGLISH);%0A    private SimpleDateFormat timeFormat = new SimpleDateFormat(%22h:mm:s,a%22, Locale.ENGLISH);%0A%0A    /**%0A     * Instantiates a new Weight log.%0A     */%0A    public WeightLog() %7B%0A        super();%0A    %7D%0A%0A    /**%0A     * Instantiates a new Weight log.%0A     *%0A     * @param weight the weight in lbs%0A     */%0A    public WeightLog(double weight) %7B%0A        this.weight = weight;%0A        this.user = UserSingleton.getInstance().getCurrentUser();%0A        this.time = Calendar.getInstance().getTimeInMillis();%0A        date = new Date(time);%0A%0A        dateFormat.setTimeZone(TimeZone.getTimeZone(%22UTC%22));%0A        timeFormat.setTimeZone(TimeZone.getTimeZone(%22UTC%22));%0A    %7D%0A%0A    /**%0A     * Gets weight in lbs%0A     *%0A     * @return the weight%0A     */%0A    public double getWeight() %7B%0A        return weight;%0A    %7D%0A%0A    /**%0A     * Gets user that owns the weight log.%0A     *%0A     * @return the user%0A     */%0A    public User getUser() %7B%0A        return user;%0A    %7D%0A%0A    /**%0A     * Gets date of the weight log.%0A     *%0A     * @return the date%0A     */%0A    public Date getDate() %7B%0A        return date;%0A    %7D%0A%0A    /**%0A     * Gets formatted date of the weight log.%0A     * Ex. March 10,2014%0A     *%0A     * @return the format date%0A     */%0A    public String getFormatDate() %7B%0A        return dateFormat.format(date);%0A    %7D%0A%0A    /**%0A     * Gets formatted time of the weight log.%0A     * Ex. 2:53:54,PM%0A     *%0A     * @return the format time%0A     */%0A    public String getFormatTime() %7B%0A        return timeFormat.format(date);%0A    %7D%0A%7D

Implement WeightLog class to keep track of user's weight.