ifi.dsb
Class TimeAxis

java.lang.Object
  extended byifi.dsb.AxisValues
      extended byifi.dsb.TimeAxis

public class TimeAxis
extends AxisValues

Class for creation of time axis for use in plotting. Objects can hold axis values, axis label and values for sampling rate and sampling period.

Author:
Svein Bøe, svein@ifi.uio.no, 2002-2003.
See Also:
FrequencyAxis

Constructor Summary
TimeAxis(double[] data)
          Constructs TimeAxis object.
TimeAxis(double[] data, java.lang.String label)
          Constructs TimeAxis object.
TimeAxis(double samplingRate, double min, double max, int length)
          Constructs TimeAxis object.
TimeAxis(double samplingRate, double min, double max, int length, java.lang.String label)
          Constructs TimeAxis object.
TimeAxis(double min, double max, int length)
          Constructs TimeAxis object.
TimeAxis(double min, double max, int length, java.lang.String label)
          Constructs TimeAxis object.
TimeAxis(double samplingRate, int length)
          Constructs TimeAxis object.
TimeAxis(double samplingRate, int length, java.lang.String label)
          Constructs TimeAxis object.
TimeAxis(int length)
          Constructs TimeAxis object.
 
Method Summary
 double getSamplingPeriod()
          Return the sampling period.
 double getSamplingRate()
          Return the sampling rate.
static void main(java.lang.String[] args)
           
 
Methods inherited from class ifi.dsb.AxisValues
getLabel, getLength, getMax, getMin, getValues, setLabel, setLength, setMax, setMin, updateValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeAxis

public TimeAxis(int length)
Constructs TimeAxis object. Sampling rate and sampling period get default values of 1.0.

Parameters:
length - Number of axis values. Axis values will span from zero to (length - 1).

TimeAxis

public TimeAxis(double samplingRate,
                int length)
Constructs TimeAxis object.

Parameters:
samplingRate - Value for sampling rate stored in the object, also used to set the sampling period value in the object. Used in this constructor as inverse of difference between consecutive axis values. Axis minimum will be zero.
length - Number of axis values.

TimeAxis

public TimeAxis(double samplingRate,
                int length,
                java.lang.String label)
Constructs TimeAxis object.

Parameters:
samplingRate - Value for sampling rate stored in the object, also used to set the sampling period value in the object. Used in this constructor as inverse of difference between consecutive axis values. Axis minimum will be zero.
length - Number of axis values.
label - Axis label.

TimeAxis

public TimeAxis(double min,
                double max,
                int length)
Constructs TimeAxis object. Sampling rate and sampling period get default values of 1.0.

Parameters:
min - Minimum axis value.
max - Maximum axis value.
length - Number of axis values.

TimeAxis

public TimeAxis(double min,
                double max,
                int length,
                java.lang.String label)
Constructs TimeAxis object. Sampling rate and sampling period get default values of 1.0.

Parameters:
min - Minimum axis value.
max - Maximum axis value.
length - Number of axis values.
label - Axis label.

TimeAxis

public TimeAxis(double[] data)
Constructs TimeAxis object.

Parameters:
data - Axis values. Minimum, maximum, length, sampling rate and sampling period are all calculated from these values.

TimeAxis

public TimeAxis(double[] data,
                java.lang.String label)
Constructs TimeAxis object.

Parameters:
data - Axis values. Minimum, maximum, length, sampling rate and sampling period are all calculated from these values.
label - Axis label.

TimeAxis

public TimeAxis(double samplingRate,
                double min,
                double max,
                int length)
Constructs TimeAxis object.

Parameters:
samplingRate - Value for sampling rate stored in the object, also used to set the sampling period value in the object.
min - Axis minimum.
max - Axis maximum
length - Number of axis values.

TimeAxis

public TimeAxis(double samplingRate,
                double min,
                double max,
                int length,
                java.lang.String label)
Constructs TimeAxis object.

Parameters:
samplingRate - Value for sampling rate stored in the object, also used to set the sampling period value in the object.
min - Axis minimum.
max - Axis maximum
length - Number of axis values.
label - Axis label.
Method Detail

getSamplingRate

public double getSamplingRate()
Return the sampling rate.


getSamplingPeriod

public double getSamplingPeriod()
Return the sampling period.


main

public static void main(java.lang.String[] args)