Package org.opengis.temporal

Examples of org.opengis.temporal.Position


    /**
     * Test of getPosition method, of class DefaultInstant.
     */
    @Test
    public void testGetPosition() {
        Position result = instant1.getPosition();
        assertFalse(instant2.getPosition().equals(result));
    }
View Full Code Here


    /**
     * Test of setPosition method, of class DefaultInstant.
     */
    @Test
    public void testSetPosition() {
        Position result = instant1.getPosition();
        Position position = new DefaultPosition(new Date());
        ((DefaultInstant) instant1).setPosition(position);
        assertFalse(instant1.getPosition().equals(result));
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        Position timePosition = new DefaultPosition(new SimpleInternationalString((String) value));
        return timePosition;
    }
View Full Code Here

     * <!-- end-user-doc -->
     */
    @Override
    public Element encode(Object object, Document document, Element value)
            throws Exception {
        Position timePosition = (Position) object;

        if (timePosition == null) {
            value.appendChild(document.createElementNS(GML.NAMESPACE, org.geotools.gml3.GML.Null.getLocalPart()));
        }

        value.appendChild(document.createTextNode(timePosition.getDateTime().toString()));
        return null;
    }
View Full Code Here

        value.appendChild(document.createTextNode(timePosition.getDateTime().toString()));
        return null;
    }

    public Object getProperty(Object object, QName name) {
        Position value = (Position) object;
       
        if (name.getLocalPart().equals("frame")) {
            return "ISO-8601";
        }
       
View Full Code Here

    } else if (data instanceof TemporalRange) {
      return toSet((TemporalRange) data);
    } else if (data instanceof TemporalConstraints) {
      return (TemporalConstraints) data;
    } else if (data instanceof Period) {
      final Position beginPosition = ((Period) data).getBeginning()
          .getPosition();
      final Position endPosition = ((Period) data).getEnding()
          .getPosition();
      Date s = TemporalRange.START_TIME, e = TemporalRange.START_TIME;

      if (beginPosition.getDate() != null)
        s = beginPosition.getDate();
      else if (beginPosition.getTime() != null)
        s = beginPosition.getTime();

      if (endPosition.getDate() != null)
        e = endPosition.getDate();
      else if (endPosition.getTime() != null)
        e = endPosition.getTime();
      return toSet(new TemporalRange(s, e));
    } else if (data instanceof Instant) {
      final Position beginPosition = ((Instant) data).getPosition();
      Date s = TemporalRange.START_TIME;
      if (beginPosition.getDate() != null)
        s = beginPosition.getDate();
      else if (beginPosition.getTime() != null)
        s = beginPosition.getTime();
      return toSet(new TemporalRange(s, s));
    }

    throw new ClassCastException("Could not cast data to TemporalRange");
  }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
            throws Exception {
        Position timePosition = new DefaultPosition(new SimpleInternationalString((String) value));
        return timePosition;
    }
View Full Code Here

     * <!-- end-user-doc -->
     */
    @Override
    public Element encode(Object object, Document document, Element value)
            throws Exception {
        Position timePosition = (Position) object;

        if (timePosition == null) {
            value.appendChild(document.createElementNS(GML.NAMESPACE, org.geotools.gml3.GML.Null.getLocalPart()));
        }

        value.appendChild(document.createTextNode(timePosition.getDateTime().toString()));
        return null;
    }
View Full Code Here

        value.appendChild(document.createTextNode(timePosition.getDateTime().toString()));
        return null;
    }

    public Object getProperty(Object object, QName name) {
        Position value = (Position) object;
       
        if (name.getLocalPart().equals("frame")) {
            return "ISO-8601";
        }
       
View Full Code Here

TOP

Related Classes of org.opengis.temporal.Position

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.