Class HALValue

java.lang.Object
edu.wpi.first.hal.HALValue

public final class HALValue extends Object
Represents a HAL entry value.
  • Field Details

  • Method Details

    • getType

      public int getType()
      Get the type of the value.
      Returns:
      Type (e.g. kBoolean).
    • 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

      public static HALValue makeBoolean(boolean value)
      Build a HAL boolean value.
      Parameters:
      value - value
      Returns:
      HAL value
    • makeEnum

      public static HALValue makeEnum(int value)
      Build a HAL enum value.
      Parameters:
      value - value
      Returns:
      HAL value
    • makeInt

      public static HALValue makeInt(int value)
      Build a HAL integer value.
      Parameters:
      value - value
      Returns:
      HAL value
    • makeLong

      public static HALValue makeLong(long value)
      Build a HAL long value.
      Parameters:
      value - value
      Returns:
      HAL value
    • makeDouble

      public static HALValue makeDouble(double value)
      Build a HAL double value.
      Parameters:
      value - value
      Returns:
      HAL value
    • makeUnassigned

      public static HALValue makeUnassigned()
      Build a HAL unassigned value.
      Returns:
      HAL value
    • fromNative

      public static HALValue fromNative(int type, long value1, double value2)
      Build a HAL value from its native components.
      Parameters:
      type - type
      value1 - long value (all except double)
      value2 - double value (for double only)
      Returns:
      HAL value