Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Timerange.java @ 3318:dbe2f85bf160
merged flys-artifacts/2.8
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:35 +0200 |
parents | 2e6f0ef36352 |
children |
comparison
equal
deleted
inserted
replaced
2987:98c7a46ec5ae | 3318:dbe2f85bf160 |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import java.io.Serializable; | |
4 | |
5 import java.util.Date; | |
6 | |
7 | |
8 /** | |
9 * This class represents time ranges specified by start and end time. Start and | |
10 * end times are stored as long (number of milliseconds since january 1, 1970). | |
11 * | |
12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
13 */ | |
14 public class Timerange implements Serializable { | |
15 | |
16 private long start; | |
17 private long end; | |
18 | |
19 | |
20 public Timerange(long start, long end) { | |
21 this.start = start; | |
22 this.end = end; | |
23 } | |
24 | |
25 | |
26 public Timerange(Date start, Date stop) { | |
27 this.start = start.getTime(); | |
28 this.end = stop != null ? stop.getTime() : System.currentTimeMillis(); | |
29 } | |
30 | |
31 | |
32 public long getStart() { | |
33 return start; | |
34 } | |
35 | |
36 | |
37 public long getEnd() { | |
38 return end; | |
39 } | |
40 } | |
41 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |