anl.aida.data
Class RegularTimeAxis

java.lang.Object
  extended by anl.aida.data.AbstractCoordAxis
      extended by anl.aida.data.RegularTimeAxis
All Implemented Interfaces:
CoordAxis, TimeCoordAxis

public class RegularTimeAxis
extends AbstractCoordAxis
implements TimeCoordAxis

TimeAxis with a regular interval


Field Summary
private  java.util.Calendar cal
           
private  int interval
           
private  TimeIntervalUnit iUnit
           
private  java.util.Date startDate
           
 
Fields inherited from class anl.aida.data.AbstractCoordAxis
attributes, data
 
Constructor Summary
RegularTimeAxis(java.util.Date start, int interval, AxisData data)
           
 
Method Summary
 AxisType getAxisType()
          Gets the type of this axis.
 java.util.Date getDate(int timestep)
          Returns the Date for the specified timestep, or null if the timestep is invalid.
 int getTimeStep(java.util.Date date)
          Gets the timestep that corresponds to the specified date.
 double getValue(int index)
          Gets the value at the specified index.
 java.lang.String getValueAsString(int index)
          Gets the value as String at the specified index.
 
Methods inherited from class anl.aida.data.AbstractCoordAxis
getAttribute, getDescription, getName, getRange, getUnits, isCompatible, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anl.aida.data.CoordAxis
getAttribute, getDescription, getName, getRange, getUnits, isCompatible
 

Field Detail

interval

private int interval

iUnit

private TimeIntervalUnit iUnit

startDate

private java.util.Date startDate

cal

private java.util.Calendar cal
Constructor Detail

RegularTimeAxis

public RegularTimeAxis(java.util.Date start,
                       int interval,
                       AxisData data)
Method Detail

getDate

public java.util.Date getDate(int timestep)
Description copied from interface: TimeCoordAxis
Returns the Date for the specified timestep, or null if the timestep is invalid.

Specified by:
getDate in interface TimeCoordAxis
Parameters:
timestep - the time step we want the date for.
Returns:
the Date for the specified timestep

getTimeStep

public int getTimeStep(java.util.Date date)
Description copied from interface: TimeCoordAxis
Gets the timestep that corresponds to the specified date. If no such timestep is found then return Axes.TIME_STEP_NOT_FOUND.

Specified by:
getTimeStep in interface TimeCoordAxis
Parameters:
date - the date whose time step we want
Returns:
the timestep that corresponds to the specified date. If no such timestep is found then return Axes.TIME_STEP_NOT_FOUND.

getAxisType

public AxisType getAxisType()
Description copied from interface: CoordAxis
Gets the type of this axis.

Specified by:
getAxisType in interface CoordAxis
Overrides:
getAxisType in class AbstractCoordAxis
Returns:
the type of this axis.

getValue

public double getValue(int index)
Description copied from interface: CoordAxis
Gets the value at the specified index.

Specified by:
getValue in interface CoordAxis
Parameters:
index - the index
Returns:
the value at the specified index.

getValueAsString

public java.lang.String getValueAsString(int index)
Gets the value as String at the specified index.

Specified by:
getValueAsString in interface CoordAxis
Parameters:
index - the index of the value to get
Returns:
the value as String at the specified index.