Class TimeCoord

  • All Implemented Interfaces:
    Comparable<TimeCoord>

    public class TimeCoord
    extends Object
    implements Comparable<TimeCoord>
    Represents a list of offset times shared among variables Tracks a list of variables that all have the same list of offset times.
    • Field Detail

    • Method Detail

      • isInterval

        public boolean isInterval()
      • getGridInventory

        public List<GridDatasetInv.Grid> getGridInventory()
        The list of GridDatasetInv.Grid that use this TimeCoord
        Returns:
        list of GridDatasetInv.Grid that use this TimeCoord
      • getId

        public int getId()
        A unique id for this TimeCoord
        Returns:
        unique id for this TimeCoord
      • setId

        public void setId​(int id)
        Set the unique id for this TimeCoord
        Parameters:
        id - id for this TimeCoord
      • getName

        public String getName()
      • getAxisName

        public String getAxisName()
      • getNCoords

        public int getNCoords()
      • getOffsetTimes

        public double[] getOffsetTimes()
        The list of valid times, in units of hours since the run time
        Returns:
        list of valid times, in units of hours since the run time
      • getBound1

        public double[] getBound1()
      • getBound2

        public double[] getBound2()
      • setOffsetTimes

        public void setOffsetTimes​(double[] offset)
      • setBounds

        public void setBounds​(double[] bound1,
                              double[] bound2)
      • equalsData

        public boolean equalsData​(TimeCoord tother)
        Instances that have the same offsetHours/bounds and runtime are equal
        Parameters:
        tother - compare this TimeCoord's data
        Returns:
        true if data are equal
      • findInterval

        public int findInterval​(double b1,
                                double b2)
      • findIndex

        public int findIndex​(double offsetHour)
      • findTimeCoord

        public static TimeCoord findTimeCoord​(List<TimeCoord> timeCoords,
                                              TimeCoord want)
        Look through timeCoords to see if one matches want. Matches means equalsData() is true. If not found, make a new one and add to timeCoords.
        Parameters:
        timeCoords - look through this list
        want - find equivilent
        Returns:
        return equivilent or make a new one and add to timeCoords
      • makeUnion

        public static TimeCoord makeUnion​(List<TimeCoord> timeCoords,
                                          CalendarDate baseDate)
        Create the union of all the values in the list of TimeCoord, ignoring the TimeCoord's runDate
        Parameters:
        timeCoords - list of TimeCoord
        baseDate - resulting union timeCoord uses this as a base date
        Returns:
        union TimeCoord