Clover Coverage Report - jmxmonitor 1.0.2
Coverage timestamp: Wed Feb 10 2010 07:36:51 GMT
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
3   61   3   1
0   12   1   3
3     1  
1    
 
  RangeFunctions       Line # 26 3 0% 3 0 100% 1.0
 
  (3)
 
1    /*
2    * Copyright 2010 Ben Gidley
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16   
17    package uk.co.gidley.jmxmonitor.functions;
18   
19    /**
20    * Library of extra functions for scripting. These are just to make it easier to do things in the scripts
21    * <p/>
22    * This library is themed around checking ranges
23    * <p/>
24    * Created by IntelliJ IDEA. User: ben Date: Jan 19, 2010 Time: 1:08:02 PM
25    */
 
26    public class RangeFunctions {
27   
28    /**
29    * Returns true IFF reading is greater than value
30    *
31    * @param reading
32    * @param value
33    * @return
34    */
 
35  2 toggle public static boolean isAbove(long reading, long value) {
36  2 return reading > value;
37    }
38   
39    /**
40    * Returns true IFF reading is less than value
41    *
42    * @param reading
43    * @param value
44    * @return
45    */
 
46  2 toggle public static boolean isBelow(long reading, long value) {
47  2 return reading < value;
48    }
49   
50    /**
51    * Returns true IFF reading is between floor and ceiling
52    *
53    * @param reading
54    * @param floor
55    * @param ceiling
56    * @return
57    */
 
58  3 toggle public static boolean isBetween(long reading, long floor, long ceiling) {
59  3 return reading < ceiling && reading > floor;
60    }
61    }