use of org.geotoolkit.gml.xml.v311.TimeInstantPropertyType in project arctic-sea by 52North.
the class OmEncoderv20 method addNilResultTime.
private void addNilResultTime(OMObservationType xbObservationTemplate) {
TimeInstantPropertyType xbResultTime = xbObservationTemplate.addNewResultTime();
xbResultTime.setNilReason(NIL_REASON_TEMPLATE);
}
use of org.geotoolkit.gml.xml.v311.TimeInstantPropertyType in project geotoolkit by Geomatys.
the class TimePeriodTypeTest method getTime3Test.
@Test
public void getTime3Test() throws Exception {
String snull = null;
TimeInstantType tb = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
TimeInstantType te = new TimeInstantType(new TimePositionType("2008-11-01T02:01:00"));
TimePeriodType tp = new TimePeriodType(null, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(60000, tp.getTime());
tb = new TimeInstantType(new TimePositionType("2008-11-01T01:00:00"));
te = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
tp = new TimePeriodType(null, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(3600000, tp.getTime());
tp = new TimePeriodType(null, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
assertEquals(-1, tp.getTime());
tp = new TimePeriodType(null, snull);
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(-1, tp.getTime());
tp = new TimePeriodType(null, snull);
assertEquals(-1, tp.getTime());
}
use of org.geotoolkit.gml.xml.v311.TimeInstantPropertyType in project arctic-sea by 52North.
the class GmlEncoderv321 method createTimeInstantPropertyType.
private XmlObject createTimeInstantPropertyType(TimeInstant time) throws EncodingException {
TimeInstantPropertyType timeInstantPropertyType = TimeInstantPropertyType.Factory.newInstance(getXmlOptions());
createTimeInstantType(time, timeInstantPropertyType.addNewTimeInstant());
return timeInstantPropertyType;
}
use of org.geotoolkit.gml.xml.v311.TimeInstantPropertyType in project geotoolkit by Geomatys.
the class TimePeriodTypeTest method getTime3Test.
@Test
public void getTime3Test() throws Exception {
final String id = "id-1";
String snull = null;
TimeInstantType tb = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
TimeInstantType te = new TimeInstantType(new TimePositionType("2008-11-01T02:01:00"));
TimePeriodType tp = new TimePeriodType(id, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(60000, tp.getTime());
tb = new TimeInstantType(new TimePositionType("2008-11-01T01:00:00"));
te = new TimeInstantType(new TimePositionType("2008-11-01T02:00:00"));
tp = new TimePeriodType(id, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(3600000, tp.getTime());
tp = new TimePeriodType(id, snull);
tp.setBegin(new TimeInstantPropertyType(tb));
assertEquals(-1, tp.getTime());
tp = new TimePeriodType(id, snull);
tp.setEnd(new TimeInstantPropertyType(te));
assertEquals(-1, tp.getTime());
tp = new TimePeriodType(id, snull);
assertEquals(-1, tp.getTime());
}
Aggregations