Source Code Cross Referenced for Query.java in  » JMX » mx4j » javax » management » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » mx4j » javax.management 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) The MX4J Contributors.
003:         * All rights reserved.
004:         *
005:         * This software is distributed under the terms of the MX4J License version 1.0.
006:         * See the terms of the MX4J License in the documentation provided with this software.
007:         */
008:
009:        package javax.management;
010:
011:        /**
012:         * Factory class for constructing query expressions.
013:         *
014:         * @version $Revision: 1.9 $
015:         */
016:        public class Query {
017:            public static final int GT = 0;
018:            public static final int LT = 1;
019:            public static final int GE = 2;
020:            public static final int LE = 3;
021:            public static final int EQ = 4;
022:
023:            public static final int PLUS = 0;
024:            public static final int MINUS = 1;
025:            public static final int TIMES = 2;
026:            public static final int DIV = 3;
027:
028:            /**
029:             * Returns a query expression for the result of the NOT operation on the given expression.
030:             */
031:            public static QueryExp not(QueryExp queryExp) {
032:                return new NotQueryExp(queryExp);
033:            }
034:
035:            /**
036:             * Returns a query expression for the result of the AND operation on the two given expressions.
037:             */
038:            public static QueryExp and(QueryExp q1, QueryExp q2) {
039:                return new AndQueryExp(q1, q2);
040:            }
041:
042:            /**
043:             * Returns a query expression for the result of the OR operation on the two given expressions.
044:             */
045:            public static QueryExp or(QueryExp q1, QueryExp q2) {
046:                return new OrQueryExp(q1, q2);
047:            }
048:
049:            /**
050:             * Returns a query expression for the result of <code>v1</code> GREATER-THAN <code>v2</code>.
051:             */
052:            public static QueryExp gt(ValueExp v1, ValueExp v2) {
053:                return new BinaryRelQueryExp(GT, v1, v2);
054:            }
055:
056:            /**
057:             * Returns a query expression for the result of <code>v1</code> GREATER-THAN-OR-EQUAL <code>v2</code>.
058:             */
059:            public static QueryExp geq(ValueExp v1, ValueExp v2) {
060:                return new BinaryRelQueryExp(GE, v1, v2);
061:            }
062:
063:            /**
064:             * Returns a query expression for the result of <code>v1</code> LESS-THAN-OR-EQUAL <code>v2</code>.
065:             */
066:            public static QueryExp leq(ValueExp v1, ValueExp v2) {
067:                return new BinaryRelQueryExp(LE, v1, v2);
068:            }
069:
070:            /**
071:             * Returns a query expression for the result of <code>v1</code> LESS-THAN <code>v2</code>.
072:             */
073:            public static QueryExp lt(ValueExp v1, ValueExp v2) {
074:                return new BinaryRelQueryExp(LT, v1, v2);
075:            }
076:
077:            /**
078:             * Returns a query expression for the result of <code>v1</code> EQUAL <code>v2</code>.
079:             */
080:            public static QueryExp eq(ValueExp v1, ValueExp v2) {
081:                return new BinaryRelQueryExp(EQ, v1, v2);
082:            }
083:
084:            /**
085:             * Returns a query expression for the result of <code>v1</code> LESS-THAN-OR-EQUAL <code>v2</code> LESS-THAN-OR-EQUAL <code>v3</code>
086:             */
087:            public static QueryExp between(ValueExp v1, ValueExp v2, ValueExp v3) {
088:                return new BetweenQueryExp(v1, v2, v3);
089:            }
090:
091:            /**
092:             * Returns a query expression for the result of <code>val</code> being present as one element of the given array.
093:             */
094:            public static QueryExp in(ValueExp val, ValueExp valueList[]) {
095:                return new InQueryExp(val, valueList);
096:            }
097:
098:            /**
099:             * Returns the expression value that represent the value of an attribute of a generic MBean.
100:             */
101:            public static AttributeValueExp attr(String name) {
102:                return new AttributeValueExp(name);
103:            }
104:
105:            /**
106:             * Returns the expression value that represent the value of an attribute of an MBean of the specified class.
107:             */
108:            public static AttributeValueExp attr(String className, String name) {
109:                return new QualifiedAttributeValueExp(className, name);
110:            }
111:
112:            /**
113:             * Returns the expression value that represent the class name of an MBean.
114:             */
115:            public static AttributeValueExp classattr() {
116:                return new ClassAttributeValueExp();
117:            }
118:
119:            /**
120:             * Returns the expression value that represent the given string.
121:             */
122:            public static StringValueExp value(String val) {
123:                return new StringValueExp(val);
124:            }
125:
126:            /**
127:             * Returns the expression value that represent the given number.
128:             */
129:            public static ValueExp value(Number val) {
130:                return new NumericValueExp(val);
131:            }
132:
133:            /**
134:             * Returns the expression value that represent the given number.
135:             */
136:            public static ValueExp value(int val) {
137:                return value(new Integer(val));
138:            }
139:
140:            /**
141:             * Returns the expression value that represent the given number.
142:             */
143:            public static ValueExp value(long val) {
144:                return value(new Long(val));
145:            }
146:
147:            /**
148:             * Returns the expression value that represent the given number.
149:             */
150:            public static ValueExp value(float val) {
151:                return value(new Float(val));
152:            }
153:
154:            /**
155:             * Returns the expression value that represent the given number.
156:             */
157:            public static ValueExp value(double val) {
158:                return value(new Double(val));
159:            }
160:
161:            /**
162:             * Returns the expression value that represent the given boolean.
163:             */
164:            public static ValueExp value(boolean val) {
165:                return new BooleanValueExp(val);
166:            }
167:
168:            /**
169:             * Returns a expression value for the result of <code>value1</code> PLUS <code>value2</code>
170:             */
171:            public static ValueExp plus(ValueExp value1, ValueExp value2) {
172:                return new BinaryOpValueExp(PLUS, value1, value2);
173:            }
174:
175:            /**
176:             * Returns a expression value for the result of <code>value1</code> MINUS <code>value2</code>
177:             */
178:            public static ValueExp minus(ValueExp value1, ValueExp value2) {
179:                return new BinaryOpValueExp(MINUS, value1, value2);
180:            }
181:
182:            /**
183:             * Returns a expression value for the result of <code>value1</code> TIMES <code>value2</code>
184:             */
185:            public static ValueExp times(ValueExp value1, ValueExp value2) {
186:                return new BinaryOpValueExp(TIMES, value1, value2);
187:            }
188:
189:            /**
190:             * Returns a expression value for the result of <code>value1</code> DIVIDED <code>value2</code>
191:             */
192:            public static ValueExp div(ValueExp value1, ValueExp value2) {
193:                return new BinaryOpValueExp(DIV, value1, value2);
194:            }
195:
196:            /**
197:             * Returns a query expression for the result of the wildcard match between the given attribute value and the string pattern.
198:             */
199:            public static QueryExp match(AttributeValueExp a, StringValueExp s) {
200:                return new MatchQueryExp(a, s);
201:            }
202:
203:            /**
204:             * Returns a query expression for the result of the match, as initial string, between the given attribute value and the string pattern.
205:             */
206:            public static QueryExp initialSubString(AttributeValueExp a,
207:                    StringValueExp s) {
208:                return new MatchQueryExp(a, new StringValueExp(s.getValue()
209:                        + "*"));
210:            }
211:
212:            /**
213:             * Returns a query expression for the result of the match, as contained string, between the given attribute value and the string pattern.
214:             */
215:            public static QueryExp anySubString(AttributeValueExp a,
216:                    StringValueExp s) {
217:                return new MatchQueryExp(a, new StringValueExp("*"
218:                        + s.getValue() + "*"));
219:            }
220:
221:            /**
222:             * Returns a query expression for the result of the match, as final string, between the given attribute value and the string pattern.
223:             */
224:            public static QueryExp finalSubString(AttributeValueExp a,
225:                    StringValueExp s) {
226:                return new MatchQueryExp(a, new StringValueExp("*"
227:                        + s.getValue()));
228:            }
229:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.