ucar.nc2.ft.fmrc
Class TimeCoord

java.lang.Object
  extended by ucar.nc2.ft.fmrc.TimeCoord
All Implemented Interfaces:
Comparable

public class TimeCoord
extends Object
implements Comparable

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
static class TimeCoord.Tinv
           
 
Field Summary
static TimeCoord EMPTY
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equalsData(TimeCoord tother)
          Instances that have the same offsetHours/bounds and runtime are equal
 int 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 TimeCoord
 int getId()
          A unique id for this TimeCoord
 String getName()
           
 int getNCoords()
           
 double[] getOffsetTimes()
          The list of valid times, in units of hours since the run time
 Date getRunDate()
           
 boolean isInterval()
           
static TimeCoord makeUnion(List<TimeCoord> timeCoords, Date baseDate)
          Create the union of all the values in the list of TimeCoord, ignoring the TimeCoord's runDate
 void setBounds(double[] bound1, double[] bound2)
           
 void setBounds(List<TimeCoord.Tinv> tinvs)
           
 void setId(int id)
          Set the unique id for this TimeCoord
 void setOffsetTimes(double[] offset)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final TimeCoord EMPTY
Method Detail

getRunDate

public Date 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)

toString

public String toString()
Overrides:
toString in class Object

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(Object o)
Specified by:
compareTo in interface Comparable

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,
                                  Date 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


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.