001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007/** A wrapper around a simulator boolean value handle. */
008public class SimBoolean extends SimValue {
009  /**
010   * Wraps a simulated value handle as returned by SimDeviceJNI.createSimValueBoolean().
011   *
012   * @param handle simulated value handle
013   */
014  public SimBoolean(int handle) {
015    super(handle);
016  }
017
018  /**
019   * Gets the simulated value.
020   *
021   * @return The current value
022   */
023  public boolean get() {
024    return SimDeviceJNI.getSimValueBoolean(m_handle);
025  }
026
027  /**
028   * Sets the simulated value.
029   *
030   * @param value the value to set
031   */
032  public void set(boolean value) {
033    SimDeviceJNI.setSimValueBoolean(m_handle, value);
034  }
035}