Examples of JulianDate


Examples of org.opengis.temporal.JulianDate

    public void testDateTrans_CalendarDate_ClockTime() {
        int[] cal = {2012, 9, 10};
        CalendarDate calendarDate = new DefaultCalendarDate(calendar1, IndeterminateValue.NOW, new SimpleInternationalString("new Era"), cal);
        Number[] clock = {12, 10, 5.488};
        ClockTime clockTime = new DefaultClockTime(calendar1, IndeterminateValue.NOW, clock);
        JulianDate result = calendar1.dateTrans(calendarDate, clockTime);
        assertTrue(calendar2.dateTrans(calendarDate, clockTime).equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.JulianDate

    @Test
    public void testDateTrans_DateAndTime() {
        int[] cal = {2012, 9, 10};
        Number[] clock = {12, 10, 5.488};
        DateAndTime dateAndTime = new DefaultDateAndTime(calendar1, null, null, cal, clock);
        JulianDate result = ((DefaultCalendar) calendar1).dateTrans(dateAndTime);
        assertTrue(((DefaultCalendar) calendar1).dateTrans(dateAndTime).equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.JulianDate

        TemporalReferenceSystem frame2 = new DefaultTemporalReferenceSystem(name2, null);
        int[] calendarDate1 = {1900, 1, 1};
        int[] calendarDate2 = {400, 1, 1};
        CalendarDate referenceDate1 = new DefaultCalendarDate(frame1, IndeterminateValue.BEFORE, new SimpleInternationalString("Gregorian calendar"), calendarDate1);
        CalendarDate referenceDate2 = new DefaultCalendarDate(frame2, IndeterminateValue.NOW, new SimpleInternationalString("Babylonian calendar"), calendarDate2);
        JulianDate julianReference = new DefaultJulianDate(frame1, IndeterminateValue.NOW, 123456789);
       
        cal.set(1900, 0, 1);
        Instant begining1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2000, 9, 17);
        Instant ending1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
View Full Code Here

Examples of org.opengis.temporal.JulianDate

    /**
     * Test of getJulianReference method, of class DefaultCalendarEra.
     */
    @Test
    public void testGetJulianReference() {
        JulianDate result = calendarEra1.getJulianReference();
        assertEquals(calendarEra2.getJulianReference(), result);
    }
View Full Code Here

Examples of org.opengis.temporal.JulianDate

    /**
     * Test of setJulianReference method, of class DefaultCalendarEra.
     */
    @Test
    public void testSetJulianReference() {
        JulianDate result = calendarEra1.getJulianReference();
        ((DefaultCalendarEra)calendarEra1).setJulianReference(new DefaultJulianDate(null, null, 785410));
        assertFalse(calendarEra1.getJulianReference().equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.JulianDate

     * @param calDate
     * @param time
     * @return
     */
    public JulianDate dateTrans(CalendarDate calDate, ClockTime time) {
        JulianDate response;
        if (calDate != null && time != null) {
            DateAndTime dateAndTime = new DefaultDateAndTime(this, calDate.getIndeterminatePosition(), calDate.getCalendarEraName(), calDate.getCalendarDate(), time.getClockTime());
            return dateTrans(dateAndTime);
        }
        GregorianCalendar gc = new GregorianCalendar(-4713, 1, 1);
View Full Code Here

Examples of org.opengis.temporal.JulianDate

     * This method is called by the Overrided method dateTrans() which take 2 arguments CalendarDate and ClockTime.
     * @param dateAndTime
     * @return
     */
    public JulianDate dateTrans(DateAndTime dateAndTime) {
        JulianDate response;
        GregorianCalendar gc = new GregorianCalendar(-4713, 1, 1);
        gc.set(GregorianCalendar.ERA, GregorianCalendar.BC);
        final int julianGre = 15 + 31 * (10 + 12 * 1582);
        TemporalCoordinateSystem refSystem = new DefaultTemporalCoordinateSystem(new NamedIdentifier(Citations.CRS, new SimpleInternationalString("Julian calendar")),
                null, gc.getTime(), new SimpleInternationalString("day"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.