Class HALValue
java.lang.Object
org.wpilib.hardware.hal.HALValue
Represents a HAL entry value.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic HALValuefromNative(int type, long value1, double value2) Build a HAL value from its native components.booleanGet the value as a boolean.doubleGet the value as a double.longgetLong()Get the value as a long.doubleGet the native double value.longGet 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 HALValueBuild a HAL unassigned value.
-
Field Details
-
UNASSIGNED
public static final int UNASSIGNEDUnassigned type.- See Also:
-
BOOLEAN
public static final int BOOLEANBoolean.- See Also:
-
DOUBLE
public static final int DOUBLEDouble.- See Also:
-
ENUM
public static final int ENUMEnum.- See Also:
-
INT
public static final int INTInt.- See Also:
-
LONG
public static final int LONGLong.- See Also:
-
-
Method Details
-
getType
public int getType()Get the type of the value.- Returns:
- Type (e.g. BOOLEAN).
-
getBoolean
public boolean getBoolean()Get the value as a boolean. Does not perform type checking.- Returns:
- value contents
-
getLong
public long getLong()Get the value as a long. Does not perform type checking.- Returns:
- value contents
-
getDouble
public double getDouble()Get the value as a double. Does not perform type checking.- Returns:
- value contents
-
getNativeLong
public long getNativeLong()Get the native long value. Does not perform type checking.- Returns:
- value contents
-
getNativeDouble
public double 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
-