anl.aida.data
Class Axes<T extends CoordAxis>

java.lang.Object
  extended by anl.aida.data.Axes<T>

public class Axes<T extends CoordAxis>
extends java.lang.Object

Encapsulates the axes / the dimensions of some data.

Version:
$Revision$ $Date$

Field Summary
private  java.util.List<T> axes
           
private  T layerAxis
           
static int TIME_STEP_NOT_FOUND
           
private  T timeAxis
           
private  T xAxis
           
private  T yAxis
           
 
Constructor Summary
Axes()
          Creates an empty set of axes.
Axes(java.util.List<T> axes)
           
 
Method Summary
 java.util.List<T> getAxes()
          Gets all the axis in this Axes object.
 T getAxis(AxisType type)
          Gets the first axis of the specified type.
 T getAxis(java.lang.String name)
          Gets the named axis.
 java.util.Date getDate(int timestep)
          Returns the Date for the specified timestep.
 java.util.Date getEndDate()
          Gets the ending date of the time axis.
 T getNonTimeAxis()
          Assumes only two axes and gets the non-time axis.
 java.util.Date getStartDate()
          Gets the starting date of the time axis.
 T getTimeAxis()
          Gets meta data for the time axis.
 int getTimeStep(java.util.Date date)
          Gets the timestep that corresponds to the specified date.
 T getXAxis()
          Gets meta data for the x-axis.
 T getYAxis()
          Gets meta data for the y-axis.
 T getZAxis()
          Gets meta data for the z or layer axis.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_STEP_NOT_FOUND

public static final int TIME_STEP_NOT_FOUND
See Also:
Constant Field Values

xAxis

private T extends CoordAxis xAxis

yAxis

private T extends CoordAxis yAxis

timeAxis

private T extends CoordAxis timeAxis

layerAxis

private T extends CoordAxis layerAxis

axes

private java.util.List<T extends CoordAxis> axes
Constructor Detail

Axes

public Axes()
Creates an empty set of axes.


Axes

public Axes(java.util.List<T> axes)
Method Detail

size

public int size()

getNonTimeAxis

public T getNonTimeAxis()
Assumes only two axes and gets the non-time axis.

Returns:
the non-time axis.

getDate

public java.util.Date getDate(int timestep)
Returns the Date for the specified timestep. If the we are unable to parse the time step axis sufficient to create a date then this returns null.

Parameters:
timestep - the time step we want the date for.
Returns:
the Date for the specified timestep, or null if there is no time axis, or null if unable to parse the time axis units.

getStartDate

public java.util.Date getStartDate()
Gets the starting date of the time axis.

Returns:
the starting date of the time axis.

getEndDate

public java.util.Date getEndDate()
Gets the ending date of the time axis.

Returns:
the ending date of the time axis.

getTimeStep

public int getTimeStep(java.util.Date date)
Gets the timestep that corresponds to the specified date. If no such timestep is found then return TIME_STEP_NOT_FOUND.

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 TIME_STEP_NOT_FOUND.

getAxes

public java.util.List<T> getAxes()
Gets all the axis in this Axes object.

Returns:
all the axis in this Axes object.

getAxis

public T getAxis(AxisType type)
Gets the first axis of the specified type.

Parameters:
type - the type of axis to get
Returns:
the first axis of the specified type or null if no axis of that type is found

getAxis

public T getAxis(java.lang.String name)
Gets the named axis.

Parameters:
name - the name of the axis to get
Returns:
the named axis or null if the axis is not found.

getZAxis

public T getZAxis()
Gets meta data for the z or layer axis.

Returns:
the metadata for the z axis or null if it doesn't exist.

getTimeAxis

public T getTimeAxis()
Gets meta data for the time axis.

Returns:
the metadata for the time axis or null if it doesn't exist.

getXAxis

public T getXAxis()
Gets meta data for the x-axis.

Returns:
the metadata for the x-axis or null if it doesn't exist.

getYAxis

public T getYAxis()
Gets meta data for the y-axis.

Returns:
the metadata for the y-axis or null if it doesn't exist.