01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.jmx.queries;
09:
10: import javax.management.QueryEval;
11: import javax.management.QueryExp;
12: import javax.management.ObjectName;
13: import javax.management.BadStringOperationException;
14: import javax.management.BadBinaryOpValueExpException;
15: import javax.management.BadAttributeValueExpException;
16: import javax.management.InvalidApplicationException;
17:
18: /**
19: *
20: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
21: */
22:
23: public class OrQueryExp extends QueryEval implements QueryExp {
24:
25: private QueryExp exp1;
26: private QueryExp exp2;
27:
28: public OrQueryExp() {
29: }
30:
31: public OrQueryExp(QueryExp queryexp, QueryExp queryexp1) {
32: exp1 = queryexp;
33: exp2 = queryexp1;
34: }
35:
36: public QueryExp getLeftExp() {
37: return exp1;
38: }
39:
40: public QueryExp getRightExp() {
41: return exp2;
42: }
43:
44: public boolean apply(ObjectName objectname)
45: throws BadStringOperationException,
46: BadBinaryOpValueExpException,
47: BadAttributeValueExpException, InvalidApplicationException {
48: return exp1.apply(objectname) || exp2.apply(objectname);
49: }
50:
51: public String toString() {
52: return "(" + exp1 + ") or (" + exp2 + ")";
53: }
54: }
|