This project has retired. For details please refer to its Attic page.
Heatmap xref
View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.hadoop.chukwa.hicc.bean;
20  
21  import java.util.ArrayList;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlElement;
26  import javax.xml.bind.annotation.XmlRootElement;
27  import javax.xml.bind.annotation.XmlType;
28  
29  @XmlRootElement
30  @XmlAccessorType(XmlAccessType.FIELD)
31  @XmlType(propOrder={})
32  public class Heatmap {
33    @XmlElement
34    private ArrayList<HeatMapPoint> data;
35    @XmlElement
36    private double max = 1.0;
37    @XmlElement
38    private int radius;
39    @XmlElement
40    private int series;
41    
42    public Heatmap() {
43  	  this.data = new ArrayList<HeatMapPoint>();
44    }
45    
46    public void put(int x, int y, double v) {
47  	  HeatMapPoint point = new HeatMapPoint(x, y, v);
48  	  data.add(point);
49    }
50    
51    public ArrayList<HeatMapPoint> getHeatmap() {
52  	  return data;
53    }
54    
55    public double getMax() {
56  	  return max;
57    }
58    
59    public void putMax(double max) {
60  	  this.max = max;
61    }
62  
63    public int getRadius() {
64  	  return radius;
65    }
66    
67    public void putRadius(int radius) {
68  	  this.radius = radius;
69    }
70    
71    public int getSeries() {
72  	  return series;
73    }
74    
75    public void putSeries(int series) {
76  	  this.series = series;
77    }
78  }