create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / gui / plot / Axis.java
1 package net.sf.openrocket.gui.plot;
2
3 import net.sf.openrocket.util.BugException;
4
5 public class Axis implements Cloneable {
6
7         private double minValue = Double.NaN;
8         private double maxValue = Double.NaN;
9         
10         
11         
12         public void addBound(double value) {
13                 
14                 if (value < minValue  ||  Double.isNaN(minValue)) {
15                         minValue = value;
16                 }
17                 if (value > maxValue  ||  Double.isNaN(maxValue)) {
18                         maxValue = value;
19                 }
20                 
21         }
22         
23         
24         public double getMinValue() {
25                 return minValue;
26         }
27         
28         public double getMaxValue() {
29                 return maxValue;
30         }
31         
32         public double getRangeLength() {
33                 return maxValue - minValue;
34         }
35         
36         public void reset() {
37                 minValue = Double.NaN;
38                 maxValue = Double.NaN;
39         }
40         
41         
42         
43         @Override
44         public Axis clone() {
45                 try {
46                         
47                         return (Axis) super.clone();
48                         
49                 } catch (CloneNotSupportedException e) {
50                         throw new BugException("BUG! Could not clone().");
51                 }
52         }
53         
54 }