Package slash.common.type

Examples of slash.common.type.CompactCalendar


        return defaultFormat.format(date);
    }

    @Test
    public void testParseTimeUTC() throws ParseException {
        CompactCalendar expectedCal = calendar(2010, 9, 18, 3, 13, 32, 0, "UTC");
        CompactCalendar actualCal = parseDateTime(asDefaultLocaleTime("18.09.2010 03:13:32"), "UTC");
        String expected = getDateTimeInstance().format(expectedCal.getTime());
        String actual = getDateTimeInstance().format(actualCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, actualCal);
    }
View Full Code Here


        assertEquals(expectedCal, actualCal);
    }

    @Test
    public void testParseTimeLocalTime() throws ParseException {
        CompactCalendar expectedCal = calendar(2010, 9, 18, 2, 13, 32, 0, "UTC");
        CompactCalendar actualCal = parseDateTime(asDefaultLocaleTime("18.09.2010 03:13:32"), "GMT+1");
        String expected = getDateTimeInstance().format(expectedCal.getTime());
        String actual = getDateTimeInstance().format(actualCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, actualCal);
    }
View Full Code Here

        String timeZonePreference = RouteConverter.getInstance().getTimeZonePreference();
        return getTimeFormat(timeZonePreference).format(time.getTime());
    }

    public static String extractDateTime(NavigationPosition position) {
        CompactCalendar time = position.getTime();
        return time != null ? formatDateTime(time) : "";
    }
View Full Code Here

        CompactCalendar time = position.getTime();
        return time != null ? formatDateTime(time) : "";
    }

    public static String extractTime(NavigationPosition position) {
        CompactCalendar time = position.getTime();
        return time != null ? formatTime(time) : "";
    }
View Full Code Here

                    public boolean run(int index, NavigationPosition position) throws Exception {
                        NavigationPosition predecessor = findPredecessorWithTime(positionsModel, index);
                        NavigationPosition successor = findSuccessorWithTime(positionsModel, index);
                        if (predecessor != null && successor != null) {
                            CompactCalendar previousTime = position.getTime();
                            CompactCalendar nextTime = intrapolateTime(position, predecessor, successor);
                            boolean changed = nextTime == null || !nextTime.equals(previousTime);
                            if (changed)
                                positionsModel.edit(index, new PositionColumnValues(DATE_TIME_COLUMN_INDEX, nextTime), false, true);
                            return changed;
                        }
                        return false;
View Full Code Here

                        if (complementTime) {
                            NavigationPosition predecessor = findPredecessorWithTime(positionsModel, index);
                            NavigationPosition successor = findSuccessorWithTime(positionsModel, index);
                            if (predecessor != null && successor != null) {
                                CompactCalendar previousTime = position.getTime();
                                CompactCalendar nextTime = intrapolateTime(position, predecessor, successor);
                                boolean changed = nextTime == null || !nextTime.equals(previousTime);
                                if (changed) {
                                    columnIndices.add(DATE_TIME_COLUMN_INDEX);
                                    columnValues.add(nextTime);
                                }
                            }
View Full Code Here

        assertEquals("Finish : 09:03:23", position2a.getReason());
        assertEquals("Cesson-Sévigné", position2a.getCity());
        assertEquals(51.9, position2a.getElevation());
        assertNull(position2a.getSpeed());
        String actualStr = DateFormat.getDateTimeInstance().format(position2a.getTime().getTime());
        CompactCalendar expected = calendar(1970, 1, 1, 9, 3, 23);
        String expectedStr = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(expectedStr, actualStr);
        assertEquals(calendar(1970, 1, 1, 9, 3, 23), position2a.getTime());

        TomTomPosition position2b = new TomTomPosition(0, 0, "Ende : Herrenberg - 14:03:45 - 437.4 m - 25.5 km");
        assertEquals("Ende : 14:03:45", position2b.getReason());
        assertEquals("Herrenberg", position2b.getCity());
        assertEquals(437.4, position2b.getElevation());
        assertNull(position2b.getSpeed());
        actualStr = DateFormat.getDateTimeInstance().format(position2b.getTime().getTime());
        expected = calendar(1970, 1, 1, 14, 3, 45);
        expectedStr = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(expectedStr, actualStr);
        assertEquals(calendar(1970, 1, 1, 14, 3, 45), position2b.getTime());

        TomTomPosition position3a = new TomTomPosition(0, 0, "13:39:33 - Distanz 2 : Weil Der Stadt - 408.3 m - 2.0 km - 39 km/h");
        assertEquals("Distanz 2", position3a.getReason());
View Full Code Here

        assertDoubleEquals(22.6, position1.getElevation());
        assertEquals("Kl\u00fctz", position1.getDescription());
        assertEquals("Kl\u00fctz", position1.getCity());
        assertEquals("Richtung 248", position1.getReason());
        assertDoubleEquals(248.0, position1.getHeading());
        CompactCalendar actual = position1.getTime();
        String cal1 = DateFormat.getDateTimeInstance().format(actual.getTime());
        CompactCalendar expected = calendar(2007, 6, 23, 14, 57, 14);
        String cal2 = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(cal2, cal1);
        assertEquals(expected.getTimeInMillis(), actual.getTimeInMillis());
        assertEquals(expected.getTime(), actual.getTime());

        GpxPosition position2 = route.getPositions().get(442);
        assertDoubleEquals(53.978, position2.getLatitude());
        assertDoubleEquals(11.1451, position2.getLongitude());
        assertDoubleEquals(18.0, position2.getElevation());
View Full Code Here

        assertDoubleEquals(17.9, position1.getElevation());
        assertDoubleEquals(13.0, position1.getSpeed());
        assertEquals("Bad Oldesloe; 170.1 Km", position1.getDescription());
        assertEquals("Bad Oldesloe; 170.1 Km", position1.getCity());
        assertEquals("Course 184", position1.getReason());
        CompactCalendar actual = position1.getTime();
        String cal1 = DateFormat.getDateTimeInstance().format(actual.getTime());
        CompactCalendar expected = calendar(2007, 7, 15, 15, 2, 53);
        String cal2 = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(cal2, cal1);
        assertEquals(expected.getTimeInMillis(), actual.getTimeInMillis());
        assertEquals(expected.getTime(), actual.getTime());

        GpxPosition position2 = route.getPositions().get(442);
        assertDoubleEquals(53.79544, position2.getLatitude());
        assertDoubleEquals(10.35700, position2.getLongitude());
        assertDoubleEquals(3.9, position2.getElevation());
View Full Code Here

        assertDoubleEquals(9.56348, position1.getLongitude());
        assertDoubleEquals(-5.4, position1.getElevation());
        assertEquals("Hohenhorst (Haselau)", position1.getDescription());
        assertEquals("Hohenhorst (Haselau)", position1.getCity());
        assertEquals("Richtung 248", position1.getReason());
        CompactCalendar actual = position1.getTime();
        String cal1 = DateFormat.getDateTimeInstance().format(actual.getTime());
        CompactCalendar expected = NavigationTestCase.calendar(file, 12, 12, 27);
        String cal2 = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(cal2, cal1);
        assertEquals(expected.getTimeInMillis(), actual.getTimeInMillis());
        assertEquals(expected.getTime(), actual.getTime());

        TomTomPosition position2 = route.getPositions().get(86);
        assertDoubleEquals(53.65074, position2.getLatitude());
        assertDoubleEquals(9.56224, position2.getLongitude());
        assertDoubleEquals(-3.3, position2.getElevation());
View Full Code Here

TOP

Related Classes of slash.common.type.CompactCalendar

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.