1 package tim.prune.data;
4 * Represents a range of altitudes, taking units into account.
5 * Values assumed to be >= 0.
7 public class AltitudeRange
9 private IntegerRange _range = new IntegerRange();
10 private int _format = Altitude.FORMAT_NONE;
14 * Add a value to the range
15 * @param inValue value to add, only positive values considered
17 public void addValue(Altitude inAltitude)
19 if (inAltitude != null)
21 int altValue = inAltitude.getValue(_format);
22 _range.addValue(altValue);
23 if (_format == Altitude.FORMAT_NONE)
25 _format = inAltitude.getFormat();
32 * @return true if positive data values were found
34 public boolean hasData()
36 return (_range.hasData());
41 * @return minimum value, or -1 if none found
43 public int getMinimum()
45 return _range.getMinimum();
50 * @return maximum value, or -1 if none found
52 public int getMaximum()
54 return _range.getMaximum();
59 * @return the altitude format used
61 public int getFormat()