1 28 29 package com.caucho.jmx.query; 30 31 import javax.management.*; 32 33 36 public class BetweenExp extends AbstractExp implements QueryExp { 37 private ValueExp _test; 38 private ValueExp _v1; 39 private ValueExp _v2; 40 41 44 public BetweenExp(ValueExp test, ValueExp v1, ValueExp v2) 45 { 46 _test = test; 47 _v1 = v1; 48 _v2 = v2; 49 } 50 51 58 public boolean apply(ObjectName name) 59 throws BadStringOperationException, BadBinaryOpValueExpException, 60 BadAttributeValueExpException, InvalidApplicationException 61 { 62 ValueExp test = _test.apply(name); 63 ValueExp v1 = _v1.apply(name); 64 ValueExp v2 = _v2.apply(name); 65 66 return ! (lt(test, v1) || lt(v2, test)); 67 } 68 69 72 public String toString() 73 { 74 return "between(" + _test + ", " + _v1 + ", " + _v2 + ")"; 75 } 76 } 77 | Popular Tags |