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 HALValue
fromNative(int type, long value1, double value2)
Build a HAL value from its native components.boolean
getBoolean()
Get the value as a boolean.double
getDouble()
Get the value as a double.long
getLong()
Get the value as a long.double
getNativeDouble()
Get the native double value.long
getNativeLong()
Get the native long value.int
getType()
Get the type of the value.static HALValue
makeBoolean(boolean value)
Build a HAL boolean value.static HALValue
makeDouble(double value)
Build a HAL double value.static HALValue
makeEnum(int value)
Build a HAL enum value.static HALValue
makeInt(int value)
Build a HAL integer value.static HALValue
makeLong(long value)
Build a HAL long value.static HALValue
makeUnassigned()
-
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
-