Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Timerange.java @ 2227:2e6f0ef36352
Added a new constructor to Timerange that takes Date objects for start and end.
flys-artifacts/trunk@3867 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 01 Feb 2012 14:43:50 +0000 |
parents | 54422e31dc27 |
children |
comparison
equal
deleted
inserted
replaced
2226:53d954973610 | 2227:2e6f0ef36352 |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | 2 |
3 import java.io.Serializable; | 3 import java.io.Serializable; |
4 | |
5 import java.util.Date; | |
4 | 6 |
5 | 7 |
6 /** | 8 /** |
7 * This class represents time ranges specified by start and end time. Start and | 9 * This class represents time ranges specified by start and end time. Start and |
8 * end times are stored as long (number of milliseconds since january 1, 1970). | 10 * end times are stored as long (number of milliseconds since january 1, 1970). |
19 this.start = start; | 21 this.start = start; |
20 this.end = end; | 22 this.end = end; |
21 } | 23 } |
22 | 24 |
23 | 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 | |
24 public long getStart() { | 32 public long getStart() { |
25 return start; | 33 return start; |
26 } | 34 } |
27 | 35 |
28 | 36 |