root / trunk / extensions / extWCS / src / es / uji / lsi / wcs / XmlWcsParsing / TimePeriod.java @ 1877
History | View | Annotate | Download (2.43 KB)
1 |
package es.uji.lsi.wcs.XmlWcsParsing; |
---|---|
2 |
/*
|
3 |
* TimePeriod.java
|
4 |
*
|
5 |
* Created on 3 de enero de 2005, 16:15
|
6 |
*/
|
7 |
|
8 |
/**
|
9 |
*
|
10 |
* @author jaume
|
11 |
*/
|
12 |
public class TimePeriod { |
13 |
private double beginPosition; |
14 |
private String beginPositionFrame; |
15 |
|
16 |
private double endPosition; |
17 |
private String endPositionFrame; |
18 |
|
19 |
private double timeResolution; |
20 |
private String timeResolutionFrame; |
21 |
|
22 |
/** Creates a new instance of TimePeriod */
|
23 |
public TimePeriod(XMLNode node) {
|
24 |
for (int i=0; i<node.getNumSubNodes(); i++){ |
25 |
XMLNode subnode = node.getSubNode(i); |
26 |
if (WCSToolkit.isWCSTab(subnode, "beginPosition")) { |
27 |
beginPosition = Double.parseDouble(subnode.getText());
|
28 |
if (subnode.getAttribute("frame") == null) beginPositionFrame = "ISO-8601"; |
29 |
else beginPositionFrame = subnode.getAttribute("frame"); |
30 |
} |
31 |
if (WCSToolkit.isWCSTab(subnode, "endPosition")) { |
32 |
endPosition = Double.parseDouble(subnode.getText());
|
33 |
if (subnode.getAttribute("frame") == null) endPositionFrame = "ISO-8601"; |
34 |
else endPositionFrame = subnode.getAttribute("frame"); |
35 |
} |
36 |
if (WCSToolkit.isWCSTab(subnode, "timeResolution")) { |
37 |
timeResolution = Double.parseDouble(subnode.getText());
|
38 |
if (subnode.getAttribute("frame") == null) timeResolutionFrame = "ISO-8601"; |
39 |
else timeResolutionFrame = subnode.getAttribute("frame"); |
40 |
} |
41 |
} |
42 |
} |
43 |
public double getBeginPosition(){ |
44 |
return beginPosition;
|
45 |
} |
46 |
|
47 |
public String getBeginPositionFrame(){ |
48 |
return beginPositionFrame;
|
49 |
} |
50 |
|
51 |
public double getEndPosition(){ |
52 |
return endPosition;
|
53 |
} |
54 |
|
55 |
public String getEndPositionFrame(){ |
56 |
return endPositionFrame;
|
57 |
} |
58 |
|
59 |
public double getTimeResolution(){ |
60 |
return timeResolution;
|
61 |
} |
62 |
|
63 |
public String getTimeResolutionFrame(){ |
64 |
return timeResolutionFrame;
|
65 |
} |
66 |
|
67 |
public String toString(){ |
68 |
return "\nTIME PERIOD: "+ |
69 |
"\nBegin position: "+getBeginPosition()+
|
70 |
"\nBegin Position: "+getBeginPositionFrame()+
|
71 |
"\nEnd Position: "+getEndPosition()+
|
72 |
"\nEnd Position Frame: "+getEndPositionFrame()+
|
73 |
"\nTime Resolution: "+getTimeResolution()+
|
74 |
"\nTime Resolution Frame: "+getTimeResolutionFrame();
|
75 |
} |
76 |
} |