PieEntry.java
1.99 KB
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
84
85
86
87
88
89
90
91
92
93
package com.github.mikephil.charting.data;
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.util.Log;
/**
* @author Philipp Jahoda
*/
@SuppressLint("ParcelCreator")
public class PieEntry extends Entry {
private String label;
public PieEntry(float value) {
super(0f, value);
}
public PieEntry(float value, Object data) {
super(0f, value, data);
}
public PieEntry(float value, Drawable icon) {
super(0f, value, icon);
}
public PieEntry(float value, Drawable icon, Object data) {
super(0f, value, icon, data);
}
public PieEntry(float value, String label) {
super(0f, value);
this.label = label;
}
public PieEntry(float value, String label, Object data) {
super(0f, value, data);
this.label = label;
}
public PieEntry(float value, String label, Drawable icon) {
super(0f, value, icon);
this.label = label;
}
public PieEntry(float value, String label, Drawable icon, Object data) {
super(0f, value, icon, data);
this.label = label;
}
/**
* This is the same as getY(). Returns the value of the PieEntry.
*
* @return
*/
public float getValue() {
return getY();
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Deprecated
@Override
public void setX(float x) {
super.setX(x);
Log.i("DEPRECATED", "Pie entries do not have x values");
}
@Deprecated
@Override
public float getX() {
Log.i("DEPRECATED", "Pie entries do not have x values");
return super.getX();
}
public PieEntry copy() {
PieEntry e = new PieEntry(getY(), label, getData());
return e;
}
@Override
public String toString() {
return "PieEntry{" +
"label='" + label + '\'' +
'}';
}
}