com.sas.graphics.components
Class TimeLength

com.sas.graphics.components.TimeLength

public class TimeLength

The TimeLength class provides an object which represents a time measurement in one of several different units.

Since:
SAS 9.1

Field Summary
static java.lang.String RB_KEY
           
 
Constructor Summary
TimeLength(double[] newValues)
          Constructs a TimeLength object from the supplied values array.
TimeLength(int aMagnitude, int aUnit)
          Constructs a TimeLength object from the specified magnitude and unit of measure.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this TimeLength.
 int getMagnitude()
          Returns the magnitude of the current measurement
 int getUnit()
          Returns the index of the unit property.
 double[] getValues()
          Return the user defined values on the axis.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

TimeLength

public TimeLength(int aMagnitude,
                  int aUnit)
Constructs a TimeLength object from the specified magnitude and unit of measure.

The magnitude for a TimeLength must be a positive non-zero value.

Valid values for unit are:

Parameters:
aMagnitude - numeric value of the measurement
aUnit - unit of measure
Throws:
java.lang.IllegalArgumentException - if the magnitude is a negative or zero value or if the unit value is not supported

TimeLength

public TimeLength(double[] newValues)
Constructs a TimeLength object from the supplied values array.

These set the values on the axis to these custom positions. When a non-null array is provided, the magnitude is internally set to "GraphConstants.TIME_INTERVAL_USER_DEFINED".

Note: a copy of the array is made when it is set here. Modifying the array after the set will have no effect on the chart. To affect a change in the chart's user defined value layout it will be necessary to call this method again with the desired settings.

Note: If placement is GraphConstants.TIME_INTERVAL_USER_DEFINED and there is no values specified which is inside the axis range, then there won't be any values displayed on the chart. This may happen either Values were left to default which is null or all the values in the array lie outside the range.

Default value array is null.

Parameters:
newValues - double[] array of all user defined tick values.
See Also:
getValues()
Method Detail

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this TimeLength.

The result is true if and only if the argument is not null and is a TimeLength object that has the same property values as this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to test for equality with this TimeLength
Returns:
true if the objects are the same; false otherwise.

getMagnitude

public int getMagnitude()
Returns the magnitude of the current measurement

Returns:
the value of the current magnitude

getUnit

public int getUnit()
Returns the index of the unit property. Valid values for unit are:

Returns:
unit of measure of the measurement

getValues

public double[] getValues()
Return the user defined values on the axis. It is used only when the unit is set to GraphConstants.TIME_INTERVAL_USER_DEFINED

Returns:
double[] array of all user defined axis values



Copyright © 2009 SAS Institute Inc. All Rights Reserved.