What's new? | Help | Directory | Sign in
Google
heron-language
Heron is an object-oriented programming language for model driven architecture
  
  
  
  
    
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
import java.util.Calendar;
import java.util.GregorianCalendar;

public class HeronDateTime {
public Calendar calendar;
public HeronDateTime() {
calendar = GregorianCalendar.getInstance();
}
public HeronDateTime(Calendar cal) {
calendar = (Calendar)cal.clone();
}
public long getMSec() {
return calendar.getTimeInMillis();
}
public long getMSecElapsedUntil(HeronDateTime time) {
return getMSec() - time.getMSec();
}
public long getMSecElapsedSince() {
return getMSecElapsedUntil(new HeronDateTime());
}
public HeronDateTime addMSec(int n) {
Calendar cal = (Calendar)calendar.clone();
cal.add(Calendar.MILLISECOND, n);
return new HeronDateTime(cal);
}
public boolean before(HeronDateTime time) {
return calendar.before(time.calendar);
}
public boolean after(HeronDateTime time) {
return time.calendar.before(calendar);
}
}
Show details Hide details

Change log

r41 by cdiggins on Feb 23, 2008   Diff

 
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 890 bytes, 32 lines