summaryrefslogtreecommitdiffstats
path: root/statistics/src/main/java/com/yahoo/statistics/ValueProxy.java
blob: 1d36d6fe7965d3aa4fbee721d86ab0e1c1782f05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.statistics;


/**
 * To be able to cache events concerning Values internally, group them
 * together and similar.
 *
 * @author  <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
 */
class ValueProxy extends Proxy {
    private double raw;
    private boolean hasRaw = false;
    private double min;
    private boolean hasMin = false;
    private double mean;
    private boolean hasMean = false;
    private double max;
    private boolean hasMax = false;
    private Histogram histogram;
    private boolean hasHistogram;

    ValueProxy(String name) {
        super(name);
    }

    boolean hasRaw() {
        return hasRaw;
    }
    double getRaw() {
        return raw;
    }
    void setRaw(double raw) {
        hasRaw = true;
        this.raw = raw;
    }

    boolean hasMin() {
        return hasMin;
    }
    double getMin() {
        return min;
    }
    void setMin(double min) {
        hasMin = true;
        this.min = min;
    }

    boolean hasMean() {
        return hasMean;
    }
    double getMean() {
        return mean;
    }
    void setMean(double mean) {
        hasMean = true;
        this.mean = mean;
    }

    boolean hasMax() {
        return hasMax;
    }
    double getMax() {
        return max;
    }
    void setMax(double max) {
        hasMax = true;
        this.max = max;
    }

    boolean hasHistogram() {
        return hasHistogram;
    }
    Histogram getHistogram() {
        return histogram;
    }
    void setHistogram(Histogram histogram) {
        hasHistogram = true;
        this.histogram = histogram;
    }

}