Here you can find the source of inRange(long value, long lowerBound, long upperBound)
Parameter | Description |
---|---|
value | a parameter |
lowerBound | the lower bound (inclusive!) of the range that is valid; |
upperBound | the upper bound (inclusive!) of the range that is valid; |
true
if the value is inside the defined range, false
if it is outside.
public static boolean inRange(long value, long lowerBound, long upperBound)
//package com.java2s; /*/*from w ww. ja v a2s . co m*/ * LibTDL - Library for parsing/handling the "Trigger Definition Language". * * (C) Copyright 2012-2013 - J.W. Janssen, <j.w.janssen@lxtreme.nl> * * Licensed under Apache Software License version 2.0, see <http://www.apache.org/licenses/LICENSE-2.0.html>. */ public class Main { /** * Validates whether a given value falls inside the given range. * * @param value * @param lowerBound * the lower bound (inclusive!) of the range that is valid; * @param upperBound * the upper bound (inclusive!) of the range that is valid; * @return <code>true</code> if the value is inside the defined range, * <code>false</code> if it is outside. */ public static boolean inRange(long value, long lowerBound, long upperBound) { return ((value >= lowerBound) && (value <= upperBound)); } }