Fix a .gitignore that is too permissive
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / histogram / HistogramScaledData.java
1 /*******************************************************************************
2 * Copyright (c) 2011 Ericsson
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 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng.ui.views.histogram;
14
15 import java.util.Arrays;
16
17 /**
18 * <b><u>HistogramScaledData</u></b>
19 * <p>
20 * Convenience class/struct for scaled histogram data.
21 */
22 public class HistogramScaledData {
23
24 // ------------------------------------------------------------------------
25 // Constants
26 // ------------------------------------------------------------------------
27
28 public static final int OUT_OF_RANGE_BUCKET = -1;
29
30 // ------------------------------------------------------------------------
31 // Attributes
32 // ------------------------------------------------------------------------
33
34 public int fWidth;
35 public int fHeight;
36 public int[] fData;
37 public long fBucketDuration;
38 public long fMaxValue;
39 public int fCurrentBucket;
40 public int fLastBucket;
41 public double fScalingFactor;
42
43 // ------------------------------------------------------------------------
44 // Constructor
45 // ------------------------------------------------------------------------
46
47 public HistogramScaledData(int width, int height) {
48 fWidth = width;
49 fHeight = height;
50 fData = new int[width];
51 Arrays.fill(fData, 0);
52 fBucketDuration = 1;
53 fMaxValue = 0;
54 fCurrentBucket = 0;
55 fLastBucket = 0;
56 fScalingFactor = 1;
57 }
58
59 public HistogramScaledData(HistogramScaledData other) {
60 fWidth = other.fWidth;
61 fHeight = other.fHeight;
62 fData = Arrays.copyOf(other.fData, fWidth);
63 fBucketDuration = other.fBucketDuration;
64 fMaxValue = other.fMaxValue;
65 fCurrentBucket = other.fCurrentBucket;
66 fLastBucket = other.fLastBucket;
67 fScalingFactor = other.fScalingFactor;
68 }
69
70 }
This page took 0.032292 seconds and 5 git commands to generate.