Package org.opengis.temporal

Examples of org.opengis.temporal.Duration


     * i.e. the absolute value of the difference between their temporal positions.
     * @param other
     * @return
     */
    public Duration distance(TemporalGeometricPrimitive other) {
        Duration response = null;
        long diff = 0L;

        if (this instanceof Instant && other instanceof Instant) {
            if (((Instant) this).getPosition().anyOther() != null && ((Instant) other).getPosition().anyOther() != null) {
                if (!((DefaultTemporalPosition) ((Instant) this).getPosition().anyOther()).getFrame().equals(((DefaultTemporalPosition) ((Instant) other).getPosition().anyOther()).getFrame())) {
View Full Code Here


    /**
     * Returns the length of this TM_GeometricPrimitive
     * @return
     */
    public Duration length() {
        Duration response = null;
        long diff = 0L;
        if (this instanceof Instant) {
            response = new DefaultPeriodDuration(Math.abs(diff));
            return response;
        } else {
View Full Code Here

        //calcul Distance with instant objects
        cal.set(2000, 0, 1);
        Position position = new DefaultPosition(cal.getTime());
        other = new DefaultInstant(position);
        Duration result = temporalGeomericPrimitive1.distance(other);
        assertFalse(temporalGeomericPrimitive2.distance(other).equals(result));

        //calcul Distance with instant and period
        cal.set(2009, 1, 1);
        Instant i1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
View Full Code Here

    @Test
    public void testLength() {
        cal.set(2020, 0, 1);
        temporalGeomericPrimitive1 = new DefaultPeriod(new DefaultInstant(position1), new DefaultInstant(position2));
        temporalGeomericPrimitive2 = new DefaultPeriod(new DefaultInstant(position2), new DefaultInstant(new DefaultPosition(cal.getTime())));
        Duration result = temporalGeomericPrimitive1.length();
        assertFalse(temporalGeomericPrimitive2.length().equals(result));
    }
View Full Code Here

TOP

Related Classes of org.opengis.temporal.Duration

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.