com.sun.electric.tool.user.waveform
Class StepSize

java.lang.Object
  extended by com.sun.electric.tool.user.waveform.StepSize

public class StepSize
extends java.lang.Object

Class to determine a sensible range of values to display for a given real range. Used by rulers, which want to display properly "gridded" values.


Constructor Summary
StepSize(double h, double l, int n)
          Constructor to analyze a range of values and determine sensible displayable values.
 
Method Summary
 double getHighValue()
          Method to return the high value to display for this range.
 double getLowValue()
          Method to return the low value to display for this range.
 int getRangeScale()
          Method to return the power of 10 used for this range.
 double getSeparation()
          Method to return the separation between ticks in this range.
 int getStepScale()
          Method to return the power of 10 used for steps in this range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StepSize

public StepSize(double h,
                double l,
                int n)
Constructor to analyze a range of values and determine sensible displayable values.

Parameters:
h - the high value in the range.
l - the low value in the range.
n - the number of steps in the range. This object contains the adjusted values of "l" and "h" as well as the integers rangeScale and stepScale, which are the powers of 10 that belong to the largest value in the interval and the step size.
Method Detail

getLowValue

public double getLowValue()
Method to return the low value to display for this range.

Returns:
the low value to display for this range.

getHighValue

public double getHighValue()
Method to return the high value to display for this range.

Returns:
the high value to display for this range.

getSeparation

public double getSeparation()
Method to return the separation between ticks in this range.

Returns:
the separation between ticks in this range.

getStepScale

public int getStepScale()
Method to return the power of 10 used for steps in this range.

Returns:
the power of 10 used for steps in this range.

getRangeScale

public int getRangeScale()
Method to return the power of 10 used for this range.

Returns:
the power of 10 used for this range.