Package edu.wpi.first.hal
Class HALValue
java.lang.Object
edu.wpi.first.hal.HALValue
public final class HALValue extends Object
-
Field Summary
-
Method Summary
Modifier and Type Method Description static HALValuefromNative(int type, long value1, double value2)Build a HAL value from its native components.booleangetBoolean()Get the value as a boolean.doublegetDouble()Get the value as a double.longgetLong()Get the value as a long.doublegetNativeDouble()Get the native double value.longgetNativeLong()Get the native long value.intgetType()Get the type of the value.static HALValuemakeBoolean(boolean value)Build a HAL boolean value.static HALValuemakeDouble(double value)Build a HAL double value.static HALValuemakeEnum(int value)Build a HAL enum value.static HALValuemakeInt(int value)Build a HAL integer value.static HALValuemakeLong(long value)Build a HAL long value.static HALValuemakeUnassigned()
-
Field Details
-
kUnassigned
- See Also:
- Constant Field Values
-
kBoolean
- See Also:
- Constant Field Values
-
kDouble
- See Also:
- Constant Field Values
-
kEnum
- See Also:
- Constant Field Values
-
kInt
- See Also:
- Constant Field Values
-
kLong
- See Also:
- Constant Field Values
-
-
Method Details
-
getType
Get the type of the value.- Returns:
- Type (e.g. kBoolean).
-
getBoolean
Get the value as a boolean. Does not perform type checking.- Returns:
- value contents
-
getLong
Get the value as a long. Does not perform type checking.- Returns:
- value contents
-
getDouble
Get the value as a double. Does not perform type checking.- Returns:
- value contents
-
getNativeLong
Get the native long value. Does not perform type checking.- Returns:
- value contents
-
getNativeDouble
Get the native double value. Does not perform type checking.- Returns:
- value contents
-
makeBoolean
Build a HAL boolean value.- Parameters:
value- value- Returns:
- HAL value
-
makeEnum
Build a HAL enum value.- Parameters:
value- value- Returns:
- HAL value
-
makeInt
Build a HAL integer value.- Parameters:
value- value- Returns:
- HAL value
-
makeLong
Build a HAL long value.- Parameters:
value- value- Returns:
- HAL value
-
makeDouble
Build a HAL double value.- Parameters:
value- value- Returns:
- HAL value
-
makeUnassigned
-
fromNative
Build a HAL value from its native components.- Parameters:
type- typevalue1- long value (all except double)value2- double value (for double only)- Returns:
- HAL value
-