forked from gsu/ETime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPunch.java
52 lines (44 loc) · 1.45 KB
/
Punch.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.etime;
/*
* This file is part of ETime.
*
* ETime is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ETime is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ETime. If not, see <http://www.gnu.org/licenses/>.
*/
import java.util.Calendar;
/**
* User: dpayne2
* Date: 1/6/12
* Time: 2:00 PM
*/
class Punch {
private Calendar calendar;
private boolean isClockIn = false; // true if this punch is a clock in
public Calendar getCalendar() {
return calendar;
}
public void setCalendar(Calendar calendar) {
this.calendar = calendar;
}
public boolean isClockIn() {
return isClockIn;
}
public void setClockIn(boolean clockIn) {
isClockIn = clockIn;
}
public String toString() {
return "Clock " + (isClockIn ? "In" : "Out") + " " + calendar.get(Calendar.HOUR_OF_DAY)
+ ":" + calendar.get(Calendar.MINUTE) + " "
+ ((calendar.get(Calendar.AM_PM) == Calendar.AM) ? "AM" : "PM");
}
}