anl.aida.data
Class AxisRange

java.lang.Object
  extended by anl.aida.data.AxisRange
All Implemented Interfaces:
CoordAxis
Direct Known Subclasses:
DataFrameAxis

public class AxisRange
extends java.lang.Object
implements CoordAxis

Defines a range along some coordinate axis.

Version:
$Revision$ $Date$

Field Summary
protected  CoordAxis axis
           
protected  Range range
           
 
Constructor Summary
AxisRange(CoordAxis axis)
          Creates an AxisRange for the specified axis with origin and extent equal to that of the axis.
AxisRange(CoordAxis axis, int origin, int extent)
          Creates an AxisRange for the specified axis with the specified origin and extent.
 
Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Gets the value of the named attribute.
 CoordAxis getAxis()
          Gets the coordinate axis for which this is a range.
 AxisType getAxisType()
          Gets the type of this axis.
 java.lang.String getDescription()
          Gets the description of this CoordAxis.
 int getExtent()
          Gets the extent of the range.
 java.lang.String getName()
          Gets the name of this CoordAxis.
 int getOrigin()
          Gets the origin of the range.
 Range getRange()
          Gets the range of this axis.
 javax.measure.unit.Unit<?> getUnits()
          Gets the unit of measurement for this coordinate axis.
 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.
 boolean isCompatible(CoordAxis axis)
          Gets whether or not the this axis is compatible with the specified axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

axis

protected CoordAxis axis

range

protected Range range
Constructor Detail

AxisRange

public AxisRange(CoordAxis axis)
Creates an AxisRange for the specified axis with origin and extent equal to that of the axis.

Parameters:
axis - the axis

AxisRange

public AxisRange(CoordAxis axis,
                 int origin,
                 int extent)
Creates an AxisRange for the specified axis with the specified origin and extent.

Parameters:
origin - the origin of the range
extent - the extent of the range
axis - the axis
Method Detail

getAxis

public CoordAxis getAxis()
Gets the coordinate axis for which this is a range.

Returns:
the coordinate axis for which this is a range.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Description copied from interface: CoordAxis
Gets the value of the named attribute.

Specified by:
getAttribute in interface CoordAxis
Parameters:
name - the name of the attribute.
Returns:
the value of the named attribute or null if no such attribute is found.

getUnits

public javax.measure.unit.Unit<?> getUnits()
Gets the unit of measurement for this coordinate axis.

Specified by:
getUnits in interface CoordAxis
Returns:
the unit of measurement for this coordinate axis.

isCompatible

public boolean isCompatible(CoordAxis axis)
Gets whether or not the this axis is compatible with the specified axis. Two axes are compatible if they can be used together in the same formula.

Specified by:
isCompatible in interface CoordAxis
Parameters:
axis - the axis to check for compatibility
Returns:
true if this axis is compatibilty with the other axis, otherise false.

getValue

public double getValue(int index)
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.

getDescription

public java.lang.String getDescription()
Gets the description of this CoordAxis.

Specified by:
getDescription in interface CoordAxis
Returns:
the description of this CoordAxis.

getName

public java.lang.String getName()
Gets the name of this CoordAxis.

Specified by:
getName in interface CoordAxis
Returns:
the name of this CoordAxis.

getRange

public Range getRange()
Gets the range of this axis.

Specified by:
getRange in interface CoordAxis
Returns:
the range of this axis.

getExtent

public int getExtent()
Gets the extent of the range.

Returns:
the extent of the range.

getOrigin

public int getOrigin()
Gets the origin of the range.

Returns:
the origin of the range.

getAxisType

public AxisType getAxisType()
Gets the type of this axis.

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