com.generationjava.math
Class Interval

java.lang.Object
  |
  +--com.generationjava.math.Interval

public class Interval
extends java.lang.Object

A continuous range between two doubles.


Constructor Summary
Interval(double lower, double upper)
          Create an Interval between two doubles.
 
Method Summary
 com.generationjava.math.Interval add(com.generationjava.math.Interval i)
          Add this Interval to another one.
 com.generationjava.math.Interval div(com.generationjava.math.Interval i)
          Divide this interval by another.
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
static com.generationjava.math.Interval makeIntervalCenterPercentage(double center, float percentage)
          Make an Interval with the specified center and the specified percentage difference from the center.
static com.generationjava.math.Interval makeIntervalCenterWidth(double center, double difference)
          Make an Interval with the specified center and difference from the center.
 com.generationjava.math.Interval mul(com.generationjava.math.Interval i)
          Multiple this Interval by another one.
 com.generationjava.math.Interval sub(com.generationjava.math.Interval i)
          Subtract an Interval from this Interval.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Interval

public Interval(double lower,
                double upper)
Create an Interval between two doubles.

Method Detail

makeIntervalCenterWidth

public static com.generationjava.math.Interval makeIntervalCenterWidth(double center,
                                                                       double difference)
Make an Interval with the specified center and difference from the center.


makeIntervalCenterPercentage

public static com.generationjava.math.Interval makeIntervalCenterPercentage(double center,
                                                                            float percentage)
Make an Interval with the specified center and the specified percentage difference from the center.


add

public com.generationjava.math.Interval add(com.generationjava.math.Interval i)
Add this Interval to another one.


mul

public com.generationjava.math.Interval mul(com.generationjava.math.Interval i)
Multiple this Interval by another one.


div

public com.generationjava.math.Interval div(com.generationjava.math.Interval i)
Divide this interval by another.


sub

public com.generationjava.math.Interval sub(com.generationjava.math.Interval i)
Subtract an Interval from this Interval.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2000-2003 OSJava. All Rights Reserved.