/*
* @(#)BetweenQueryExp.java 4.18 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.management;
/**
* This class is used by the query-building mechanism to represent binary
* relations.
* @serial include
*
* @since 1.5
*/
class BetweenQueryExp extends QueryEval implements QueryExp {
/* Serial version */
private static final long serialVersionUID = -2933597532866307444L;
/**
* @serial The checked value
*/
private ValueExp exp1;
/**
* @serial The lower bound value
*/
private ValueExp exp2;
/**
* @serial The upper bound value
*/
private ValueExp exp3;
/**
* Basic Constructor.
*/
public BetweenQueryExp() {
}
/**
* Creates a new BetweenQueryExp with v1 checked value, v2 lower bound
* and v3 upper bound values.
*/
public BetweenQueryExp(ValueExp v1, ValueExp v2, ValueExp v3) {
exp1 = v1;
exp2 = v2;
exp3 = v3;
}
/**
* Returns the checked value of the query.
*/
public ValueExp getCheckedValue() {
return exp1;
}
/**
* Returns the lower bound value of the query.
*/
public ValueExp getLowerBound() {
return exp2;
}
/**
* Returns the upper bound value of the query.
*/
public ValueExp getUpperBound() {
return exp3;
}
/**
* Applies the BetweenQueryExp on an MBean.
*
* @param name The name of the MBean on which the BetweenQueryExp will be applied.
*
* @return True if the query was successfully applied to the MBean, false otherwise.
*
* @exception BadStringOperationException
* @exception BadBinaryOpValueExpException
* @exception BadAttributeValueExpException
* @exception InvalidApplicationException
*/
public boolean apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException,
BadAttributeValueExpException, InvalidApplicationException {
ValueExp val1 = exp1.apply(name);
ValueExp val2 = exp2.apply(name);
ValueExp val3 = exp3.apply(name);
String sval1;
String sval2;
String sval3;
double dval1;
double dval2;
double dval3;
long lval1;
=1= |