-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathRadarEntryDouble.kt
More file actions
39 lines (27 loc) · 1.17 KB
/
RadarEntryDouble.kt
File metadata and controls
39 lines (27 loc) · 1.17 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
package info.appdev.charting.data
import android.annotation.SuppressLint
/**
* High-precision radar entry that stores the value as Double, extending [RadarEntryFloat]
* so it works seamlessly in the existing radar chart rendering pipeline.
* Use [valueDouble] for full-precision access.
* Radar entries have no meaningful x-axis value.
*/
@SuppressLint("ParcelCreator")
open class RadarEntryDouble : RadarEntryFloat {
var valueDouble: Double = 0.0
override var y: Float
get() = valueDouble.toFloat()
set(value) { valueDouble = value.toDouble() }
@get:Deprecated("")
@set:Deprecated("")
@Suppress("DEPRECATION")
override var x: Float
get() = super.x
set(x) { super.x = x }
constructor(value: Double) : super(value.toFloat()) { valueDouble = value }
constructor(value: Double, data: Any?) : super(value.toFloat(), data) { valueDouble = value }
/** Full-precision value (same as [valueDouble]). */
val valuePrecise: Double get() = valueDouble
override fun copy(): RadarEntryDouble = RadarEntryDouble(valueDouble, data)
override fun toString(): String = "RadarEntryDouble valueDouble=$valueDouble"
}