Class CoordinateAxis1DTime

    • Method Detail

      • getCalendarDate

        public CalendarDate getCalendarDate​(int idx)
        Get the the ith CalendarDate.
        Parameters:
        idx - index
        Returns:
        the ith CalendarDate
      • getCalendarDateRange

        public CalendarDateRange getCalendarDateRange()
        Get calendar date range
        Returns:
        calendar date range
      • getNames

        public List<NamedObject> getNames()
        Description copied from class: CoordinateAxis1D
        Get the list of names, to be used for user selection. The ith one refers to the ith coordinate.
        Overrides:
        getNames in class CoordinateAxis1D
        Returns:
        List of ucar.nc2.util.NamedObject, or empty list.
      • getTimeResolution

        public TimeUnit getTimeResolution()
                                   throws Exception
        only if isRegular() LOOK REDO
        Returns:
        time unit
        Throws:
        Exception - on bad unit string
      • findTimeIndexFromCalendarDate

        public int findTimeIndexFromCalendarDate​(CalendarDate d)
        Given a Date, find the corresponding time index on the time coordinate axis. Can only call this is hasDate() is true. This will return
        • i, if time(i) <= d < time(i+1).
        • 0, if d < time(0)
        • n-1, if d > time(n-1), where n is length of time coordinates
        Parameters:
        d - date to look for
        Returns:
        corresponding time index on the time coordinate axis
        Throws:
        UnsupportedOperationException - is no time axis or isDate() false
      • hasCalendarDate

        public boolean hasCalendarDate​(CalendarDate date)
        See if the given CalendarDate appears as a coordinate
        Parameters:
        date - test this
        Returns:
        true if equals a coordinate
      • getCalendarDates

        public List<CalendarDate> getCalendarDates()
        Get the list of datetimes in this coordinate as CalendarDate objects.
        Returns:
        list of CalendarDates.
      • getCoordBoundsDate

        public CalendarDate[] getCoordBoundsDate​(int i)
      • getCoordBoundsMidpointDate

        public CalendarDate getCoordBoundsMidpointDate​(int i)
      • getTimeDates

        public Date[] getTimeDates()
        Deprecated.
        use getCalendarDates() to correctly interpret calendars
        Does not handle non-standard Calendars
      • getTimeDate

        public Date getTimeDate​(int idx)
        Deprecated.
        use getCalendarDate()
        Does not handle non-standard Calendars
      • getDateRange

        public DateRange getDateRange()
        Deprecated.
        use getCalendarDateRange()
        Does not handle non-standard Calendars
      • findTimeIndexFromDate

        public int findTimeIndexFromDate​(Date d)
        Deprecated.
        use findTimeIndexFromCalendarDate
        Does not handle non-standard Calendars
      • hasTime

        public boolean hasTime​(Date date)
        Deprecated.
        use hasCalendarDate
        Does not handle non-standard Calendars
      • builder

        public static CoordinateAxis1DTime.Builder<?> builder()
        Get Builder for this class that allows subclassing.
        See Also:
        "https://community.oracle.com/blogs/emcmanus/2010/10/24/using-builder-pattern-subclasses"