1 /*******************************************************************************
2 * Copyright (c) 2011 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.histogram
;
15 import java
.util
.Arrays
;
18 * <b><u>HistogramScaledData</u></b>
20 * Convenience class/struct for scaled histogram data.
22 public class HistogramScaledData
{
24 // ------------------------------------------------------------------------
26 // ------------------------------------------------------------------------
28 public static final int OUT_OF_RANGE_BUCKET
= -1;
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
37 public long fBucketDuration
;
38 public long fMaxValue
;
39 public int fCurrentBucket
;
40 public int fLastBucket
;
41 public double fScalingFactor
;
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
47 public HistogramScaledData(int width
, int height
) {
50 fData
= new int[width
];
51 Arrays
.fill(fData
, 0);
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
;