Package ucar.nc2.ft.fmrc
Class TimeCoord
- java.lang.Object
-
- ucar.nc2.ft.fmrc.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeCoord.Tinv
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TimeCoord o)
boolean
equalsData(TimeCoord tother)
Instances that have the same offsetHours/bounds and runtime are equalint
findIndex(double offsetHour)
int
findInterval(double b1, double b2)
static TimeCoord
findTimeCoord(List<TimeCoord> timeCoords, TimeCoord want)
Look through timeCoords to see if one matches want.String
getAxisName()
double[]
getBound1()
double[]
getBound2()
List<GridDatasetInv.Grid>
getGridInventory()
The list of GridDatasetInv.Grid that use this TimeCoordint
getId()
A unique id for this TimeCoordString
getName()
int
getNCoords()
double[]
getOffsetTimes()
The list of valid times, in units of hours since the run timeCalendarDate
getRunDate()
boolean
isInterval()
static TimeCoord
makeUnion(List<TimeCoord> timeCoords, CalendarDate baseDate)
Create the union of all the values in the list of TimeCoord, ignoring the TimeCoord's runDatevoid
setBounds(double[] bound1, double[] bound2)
void
setBounds(List<TimeCoord.Tinv> tinvs)
void
setId(int id)
Set the unique id for this TimeCoordvoid
setOffsetTimes(double[] offset)
String
toString()
-
-
-
Field Detail
-
EMPTY
public static final TimeCoord EMPTY
-
-
Method Detail
-
getRunDate
public CalendarDate getRunDate()
-
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)
-
setBounds
public void setBounds(List<TimeCoord.Tinv> tinvs)
-
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)
-
compareTo
public int compareTo(TimeCoord o)
- Specified by:
compareTo
in interfaceComparable<TimeCoord>
-
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 listwant
- 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 TimeCoordbaseDate
- resulting union timeCoord uses this as a base date- Returns:
- union TimeCoord
-
-