Here you can find the source of inRange(int value, int min, int max)
Parameter | Description |
---|---|
value | test value |
min | a parameter |
max | a parameter |
public static boolean inRange(int value, int min, int max)
//package com.java2s; /**/*from w ww.j a v a 2 s. co m*/ * Copyright (c) 2010-2019 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ public class Main { /** * inRange checks if a value is between two other values * * @param value test value * @param min * @param max * @return true or false */ public static boolean inRange(int value, int min, int max) { if (value < min) { return false; } if (value > max) { return false; } return true; } }