Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Timerange.java @ 3468:f37e7e8907cb
merged flys-artifacts/2.8.1
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:39 +0200 |
parents | 2e6f0ef36352 |
children |
comparison
equal
deleted
inserted
replaced
3387:5ffad8bde8ad | 3468:f37e7e8907cb |
---|---|
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 : |