This site requires javascript.
Android Code Search
file:androidx/health/connect/client/units/Mass.kt symbol:grams
search
close
info_outline
more_vert
Result 1 of 1
content_copy
Search Result Root
androidx/platform/frameworks/support
keyboard_arrow_right
Branch
Branch
androidx-main
keyboard_arrow_right
Search Result Path
health/connect/connect-client/src/main/java/androidx/health/connect/client/units/
Mass.kt
content_copy
Preview
35:
36:
37:
@
get
:JvmName(
"getGrams"
)
val
in
Grams
: Double
get
() = value * type.gramsPerUnit
95:
96:
97:
/** Creates [Mass] with the specified value in grams. */
@JvmStatic
fun
grams
(value: Double): Mass = Mass(value, Type.GRAMS)
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
private
enum
class
Type {
GRAMS
{
override
val
grams
PerUnit: Double =
1.0
},
KILO
GRAMS
{
override
val
grams
PerUnit: Double =
1000.0
},
MILLI
GRAMS
{
override
val
grams
PerUnit: Double =
0.001
},
MICRO
GRAMS
{
override
val
grams
PerUnit: Double =
0.000001
139:
140:
141:
@
get
:JvmSynthetic
val
Double.
grams
: Mass
get
() = Mass.grams(value = this)
144:
145:
146:
@
get
:JvmSynthetic
val
Float.
grams
: Mass
get
() = toDouble().grams
149:
150:
151:
@
get
:JvmSynthetic
val
Long.
grams
: Mass
get
() = toDouble().grams
154:
155:
156:
@
get
:JvmSynthetic
val
Int.
grams
: Mass
get
() = toDouble().grams
unfold_more
Show 21 more matching lines
chevron_left
1
chevron_right
Results per page
10
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Got it
Help
Open branch androidx-main