FreeHEP API
Version current

org.freehep.util.parameterdatabase.types
Class DoubleRange

java.lang.Object
  extended byorg.freehep.util.parameterdatabase.types.DoubleRange

public class DoubleRange
extends Object

This class represents a continuous range of double values which includes the given endpoints.

Source Code:
DoubleRange.java

Nested Class Summary
protected  class DoubleRange.RangeFormatException
          This exception will be thrown if the String describing the range is invalid for any reason.
 
Constructor Summary
DoubleRange(double minimum, double maximum)
          Create a DoubleRange which represents a continuous range of double values from the given minimum to the given maximum.
DoubleRange(String range)
          This creates a DoubleRange from a String with the following format: [min,max], where min and max are valid double strings.
 
Method Summary
 double forceInRange(double d)
          Return the double value d clipped to the range represented by this object.
 double getMaximum()
          Return the maximum end of the range.
 double getMinimum()
          Return the minimum end of the range.
 boolean inRange(double d)
          Check to see if the given double is in the range represented by this object.
 String toString()
          Writes out the range in the format [min,max].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleRange

public DoubleRange(double minimum,
                   double maximum)
Create a DoubleRange which represents a continuous range of double values from the given minimum to the given maximum. The endpoints are included in this range.


DoubleRange

public DoubleRange(String range)
This creates a DoubleRange from a String with the following format: [min,max], where min and max are valid double strings. If min or max is an empty string, then it represents the smallest or largest double, respectively. The brackets must be included.

Method Detail

toString

public String toString()
Writes out the range in the format [min,max]. If min or max is the empty string, then it represents the smallest or largest double value, respectively.


getMinimum

public double getMinimum()
Return the minimum end of the range.


getMaximum

public double getMaximum()
Return the maximum end of the range.


inRange

public boolean inRange(double d)
Check to see if the given double is in the range represented by this object.


forceInRange

public double forceInRange(double d)
Return the double value d clipped to the range represented by this object.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.