ucar.nc2.dataset
Class CoordinateAxis1DTime

java.lang.Object
  extended by ucar.nc2.Variable
      extended by ucar.nc2.dataset.VariableDS
          extended by ucar.nc2.dataset.CoordinateAxis
              extended by ucar.nc2.dataset.CoordinateAxis1D
                  extended by ucar.nc2.dataset.CoordinateAxis1DTime
All Implemented Interfaces:
Comparable<VariableSimpleIF>, Enhancements, EnhanceScaleMissing, VariableEnhanced, ProxyReader, VariableIF, VariableSimpleIF

public class CoordinateAxis1DTime
extends CoordinateAxis1D

A 1-dimensional Coordinate Axis representing Calendar time. Its coordinate values can be represented as Dates.

May use udunit dates, or ISO Strings.

Author:
caron

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.dataset.CoordinateAxis
CoordinateAxis.AxisComparator
 
Nested classes/interfaces inherited from class ucar.nc2.Variable
Variable.Cache
 
Field Summary
 
Fields inherited from class ucar.nc2.dataset.CoordinateAxis
axisType, boundaryRef, isContiguous, ncd, positive
 
Fields inherited from class ucar.nc2.dataset.VariableDS
orgDataType, orgName, orgVar
 
Fields inherited from class ucar.nc2.Variable
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, group, isMetadata, isVariableLength, ncfile, parent, proxyReader, shape, shapeAsSection, shortName, sizeToCache, spiObject
 
Method Summary
protected  Variable copy()
           
static CoordinateAxis1DTime factory(NetcdfDataset ncd, VariableDS org, Formatter errMessages)
           
 int findTimeIndexFromDate(Date d)
          Given a Date, find the corresponding time index on the time coordinate axis.
 DateRange getDateRange()
           
 List<NamedObject> getNames()
          Get the list of names, to be used for user selection.
 Date getTimeDate(int idx)
           
 Date[] getTimeDates()
          Get the list of times as Dates.
 TimeUnit getTimeResolution()
          only if isRegular() LOOK REDO
 boolean hasTime(Date date)
          See if the given Date appears is a coordinate
 CoordinateAxis1D section(Range r)
          Create a new CoordinateAxis1D as a section of this CoordinateAxis1D.
 
Methods inherited from class ucar.nc2.dataset.CoordinateAxis1D
copyNoCache, findCoordElement, findCoordElement, findCoordElementBounded, getBound1, getBound2, getCoordEdge, getCoordEdges, getCoordEdges, getCoordName, getCoordValue, getCoordValues, getIncrement, getMaxValue, getMinValue, getStart, isContiguous, isInterval, isRegular
 
Methods inherited from class ucar.nc2.dataset.CoordinateAxis
equals, factory, getAxisType, getBoundaryRef, getInfo, getPositive, getUnitsString, hashCode, isNumeric, setAxisType, setBoundaryRef, setPositive
 
Methods inherited from class ucar.nc2.dataset.VariableDS
_read, _read, addCoordinateSystem, clearCoordinateSystems, convertEnums, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, enhance, getCoordinateSystems, getDescription, getEnhanceMode, getMissingDataArray, getOriginalDataType, getOriginalName, getOriginalVariable, getUseNaNs, getValidMax, getValidMin, hasCachedDataRecurse, hasFillValue, hasInvalidData, hasMissing, hasMissingValue, hasScaleOffset, isFillValue, isInvalidData, isMissing, isMissingFast, isMissingValue, lookupEnumString, reallyRead, reallyRead, removeCoordinateSystem, setCaching, setFillValueIsMissing, setInvalidDataIsMissing, setMissingDataIsMissing, setName, setOriginalVariable, setUnitsString, setUseNaNs, showScaleMissingProxy, toStringDebug
 
Methods inherited from class ucar.nc2.Variable
addAttribute, clone, compareTo, createNewCache, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getFullName, getFullNameEscaped, getName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShortName, getSize, getSizeToCache, getSPobject, hasCachedData, invalidateCache, isCaching, isCoordinateVariable, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setImmutable, setIsScalar, setParentGroup, setParentStructure, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, slice, toString, writeCDL, writeCDL
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.nc2.VariableIF
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getFullName, getFullNameEscaped, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, section
 
Methods inherited from interface ucar.nc2.VariableSimpleIF
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

factory

public static CoordinateAxis1DTime factory(NetcdfDataset ncd,
                                           VariableDS org,
                                           Formatter errMessages)
                                    throws IOException
Throws:
IOException

copy

protected Variable copy()
Overrides:
copy in class CoordinateAxis1D

getTimeDates

public Date[] getTimeDates()
Get the list of times as Dates.

Returns:
array of java.util.Date, or null.

getTimeDate

public Date getTimeDate(int idx)

getDateRange

public DateRange getDateRange()

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

findTimeIndexFromDate

public int findTimeIndexFromDate(Date 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

Parameters:
d - date to look for
Returns:
corresponding time index on the time coordinate axis
Throws:
UnsupportedOperationException - is no time axis or isDate() false

hasTime

public boolean hasTime(Date date)
See if the given Date appears is a coordinate

Parameters:
date - test this
Returns:
true if equals a coordinate

section

public CoordinateAxis1D section(Range r)
                         throws InvalidRangeException
Description copied from class: CoordinateAxis1D
Create a new CoordinateAxis1D as a section of this CoordinateAxis1D.

Overrides:
section in class CoordinateAxis1D
Parameters:
r - the section range
Returns:
a new CoordinateAxis1D as a section of this CoordinateAxis1D
Throws:
InvalidRangeException - if IllegalRange


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