BaseEntry.java
1.72 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
94
95
96
97
package com.github.mikephil.charting.data;
import android.graphics.drawable.Drawable;
/**
* Created by Philipp Jahoda on 02/06/16.
*/
public abstract class BaseEntry {
/** the y value */
private float y = 0f;
/** optional spot for additional data this Entry represents */
private Object mData = null;
/** optional icon image */
private Drawable mIcon = null;
public BaseEntry() {
}
public BaseEntry(float y) {
this.y = y;
}
public BaseEntry(float y, Object data) {
this(y);
this.mData = data;
}
public BaseEntry(float y, Drawable icon) {
this(y);
this.mIcon = icon;
}
public BaseEntry(float y, Drawable icon, Object data) {
this(y);
this.mIcon = icon;
this.mData = data;
}
/**
* Returns the y value of this Entry.
*
* @return
*/
public float getY() {
return y;
}
/**
* Sets the icon drawable
*
* @param icon
*/
public void setIcon(Drawable icon) {
this.mIcon = icon;
}
/**
* Returns the icon of this Entry.
*
* @return
*/
public Drawable getIcon() {
return mIcon;
}
/**
* Sets the y-value for the Entry.
*
* @param y
*/
public void setY(float y) {
this.y = y;
}
/**
* Returns the data, additional information that this Entry represents, or
* null, if no data has been specified.
*
* @return
*/
public Object getData() {
return mData;
}
/**
* Sets additional data this Entry should represent.
*
* @param data
*/
public void setData(Object data) {
this.mData = data;
}
}