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 enum value handle. */ 008public class SimEnum extends SimValue { 009 /** 010 * Wraps a simulated value handle as returned by SimDeviceJNI.createSimValueEnum(). 011 * 012 * @param handle simulated value handle 013 */ 014 public SimEnum(int handle) { 015 super(handle); 016 } 017 018 /** 019 * Gets the simulated value. 020 * 021 * @return The current value 022 */ 023 public int get() { 024 return SimDeviceJNI.getSimValueEnum(m_handle); 025 } 026 027 /** 028 * Sets the simulated value. 029 * 030 * @param value the value to set 031 */ 032 public void set(int value) { 033 SimDeviceJNI.setSimValueEnum(m_handle, value); 034 } 035}