analysis.lami: correctly handle Number (double, long etc.) type graphing
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.lami.ui / src / org / eclipse / tracecompass / internal / provisional / analysis / lami / ui / viewers / LamiGraphRange.java
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Jonathan Rajotte-Julien
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.provisional.analysis.lami.ui.viewers;
11
12 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
13
14 import java.math.BigDecimal;
15
16 /**
17 * BigDecimal based range representation
18 *
19 * @author Jonathan Rajotte-Julien
20 */
21 public class LamiGraphRange {
22
23 private final BigDecimal fMinimum;
24 private final BigDecimal fMaximum;
25 private final BigDecimal fRange;
26
27 /**
28 * Constructor
29 *
30 * @param minimum
31 * The minimum value of the range
32 * @param maximum
33 * The maximum value of the range
34 */
35 public LamiGraphRange(BigDecimal minimum, BigDecimal maximum) {
36 fMinimum = minimum;
37 fMaximum = maximum;
38 fRange = checkNotNull(maximum.subtract(minimum));
39 }
40
41 /**
42 * @return the minimum value of the range
43 */
44 public BigDecimal getMinimum() {
45 return fMinimum;
46 }
47
48 /**
49 * @return the maximum value of the range
50 */
51 public BigDecimal getMaximum() {
52 return fMaximum;
53 }
54
55 /**
56 * @return the range delta
57 */
58 public BigDecimal getDelta() {
59 return fRange;
60 }
61 }
This page took 0.032126 seconds and 5 git commands to generate.