RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
EnergyUnit.java
1
// Copyright (c) FIRST and other WPILib contributors.
2
// Open Source Software; you can modify and/or share it under the terms of
3
// the WPILib BSD license file in the root directory of this project.
4
5
package
org.wpilib.units;
6
7
import
org.wpilib.units.measure.Energy;
8
18
public
final
class
EnergyUnit
extends
Unit
{
19
EnergyUnit(
20
EnergyUnit baseUnit,
21
UnaryFunction
toBaseConverter,
22
UnaryFunction
fromBaseConverter,
23
String
name
,
24
String
symbol
) {
25
super(baseUnit, toBaseConverter, fromBaseConverter,
name
,
symbol
);
26
}
27
28
EnergyUnit(EnergyUnit baseUnit,
double
baseUnitEquivalent, String
name
, String
symbol
) {
29
super(baseUnit, baseUnitEquivalent,
name
,
symbol
);
30
}
31
32
@Override
33
public
EnergyUnit
getBaseUnit
() {
34
return
(EnergyUnit) super.
getBaseUnit
();
35
}
36
43
@Override
44
public
PowerUnit
per
(
TimeUnit
period) {
45
return
PowerUnit
.
combine
(
this
, period);
46
}
47
55
public <U extends Unit>
PerUnit<EnergyUnit, U>
per
(U other) {
56
return
PerUnit
.
combine
(
this
, other);
57
}
58
66
public
double
convertFrom
(
double
magnitude, EnergyUnit otherUnit) {
67
return
fromBaseUnits
(otherUnit.
toBaseUnits
(magnitude));
68
}
69
70
@Override
71
public
Energy
of
(
double
magnitude) {
72
return
new
Energy(magnitude,
toBaseUnits
(magnitude),
this
);
73
}
74
75
@Override
76
public
Energy
ofBaseUnits
(
double
baseUnitMagnitude) {
77
return
new
Energy(
fromBaseUnits
(baseUnitMagnitude), baseUnitMagnitude,
this
);
78
}
79
80
@Override
81
public
Energy
zero
() {
82
return
(Energy) super.zero();
83
}
84
85
@Override
86
public
Energy
one
() {
87
return
(Energy) super.one();
88
}
89
}
org.wpilib.units.EnergyUnit.ofBaseUnits
Energy ofBaseUnits(double baseUnitMagnitude)
Definition
EnergyUnit.java:76
org.wpilib.units.EnergyUnit.of
Energy of(double magnitude)
Definition
EnergyUnit.java:71
org.wpilib.units.EnergyUnit.zero
Energy zero()
Definition
EnergyUnit.java:81
org.wpilib.units.EnergyUnit.getBaseUnit
EnergyUnit getBaseUnit()
Definition
EnergyUnit.java:33
org.wpilib.units.EnergyUnit.one
Energy one()
Definition
EnergyUnit.java:86
org.wpilib.units.EnergyUnit.convertFrom
double convertFrom(double magnitude, EnergyUnit otherUnit)
Definition
EnergyUnit.java:66
org.wpilib.units.EnergyUnit.per
PowerUnit per(TimeUnit period)
Definition
EnergyUnit.java:44
org.wpilib.units.PerUnit
Definition
PerUnit.java:17
org.wpilib.units.PerUnit.combine
static< N extends Unit, D extends Unit > PerUnit< N, D > combine(N numerator, D denominator)
Definition
PerUnit.java:93
org.wpilib.units.PowerUnit
Definition
PowerUnit.java:21
org.wpilib.units.PowerUnit.combine
static PowerUnit combine(EnergyUnit energy, TimeUnit period)
Definition
PowerUnit.java:50
org.wpilib.units.TimeUnit
Definition
TimeUnit.java:18
org.wpilib.units.Unit.toBaseUnits
double toBaseUnits(double valueInNativeUnits)
Definition
Unit.java:166
org.wpilib.units.Unit.name
String name()
Definition
Unit.java:234
org.wpilib.units.Unit.symbol
String symbol()
Definition
Unit.java:243
org.wpilib.units.Unit.Unit
Unit(Unit baseUnit, UnaryFunction toBaseConverter, UnaryFunction fromBaseConverter, String name, String symbol)
Definition
Unit.java:38
org.wpilib.units.Unit.fromBaseUnits
double fromBaseUnits(double valueInBaseUnits)
Definition
Unit.java:156
org.wpilib.units.UnaryFunction
Definition
UnaryFunction.java:17
org
wpilib
units
EnergyUnit.java
Generated by
1.18.0