jdk/src/share/classes/javax/management/Query.java
author rriggs
Tue, 12 Nov 2013 14:03:28 -0500
changeset 21656 d4c777ccb1db
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
8028014: Doclint warning/error cleanup in javax.management Summary: Improve generated html by fixing doclint warnings Reviewed-by: sla, jbachorik
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     2
 * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
/**
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    30
 * <p>Constructs query object constraints.</p>
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    31
 *
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    32
 * <p>The MBean Server can be queried for MBeans that meet a particular
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    33
 * condition, using its {@link MBeanServer#queryNames queryNames} or
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    34
 * {@link MBeanServer#queryMBeans queryMBeans} method.  The {@link QueryExp}
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    35
 * parameter to the method can be any implementation of the interface
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    36
 * {@code QueryExp}, but it is usually best to obtain the {@code QueryExp}
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    37
 * value by calling the static methods in this class.  This is particularly
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    38
 * true when querying a remote MBean Server: a custom implementation of the
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    39
 * {@code QueryExp} interface might not be present in the remote MBean Server,
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    40
 * but the methods in this class return only standard classes that are
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    41
 * part of the JMX implementation.</p>
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    42
 *
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    43
 * <p>As an example, suppose you wanted to find all MBeans where the {@code
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    44
 * Enabled} attribute is {@code true} and the {@code Owner} attribute is {@code
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    45
 * "Duke"}. Here is how you could construct the appropriate {@code QueryExp} by
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    46
 * chaining together method calls:</p>
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    47
 *
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    48
 * <pre>
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    49
 * QueryExp query =
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    50
 *     Query.and(Query.eq(Query.attr("Enabled"), Query.value(true)),
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    51
 *               Query.eq(Query.attr("Owner"), Query.value("Duke")));
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    52
 * </pre>
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
    53
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 public class Query extends Object   {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
      * A code representing the {@link Query#gt} query.  This is chiefly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
      * of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     public static final int GT  = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
      * A code representing the {@link Query#lt} query.  This is chiefly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
      * of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     public static final int LT  = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
      * A code representing the {@link Query#geq} query.  This is chiefly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
      * of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     public static final int GE  = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
      * A code representing the {@link Query#leq} query.  This is chiefly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
      * of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     public static final int LE  = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
      * A code representing the {@link Query#eq} query.  This is chiefly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
      * of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     public static final int EQ  = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
      * A code representing the {@link Query#plus} expression.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
      * is chiefly of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     public static final int PLUS  = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
      * A code representing the {@link Query#minus} expression.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
      * is chiefly of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     public static final int MINUS = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
      * A code representing the {@link Query#times} expression.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
      * is chiefly of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     public static final int TIMES = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
      * A code representing the {@link Query#div} expression.  This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
      * chiefly of interest for the serialized form of queries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     public static final int DIV   = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
      * Basic constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     public Query() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
      * Returns a query expression that is the conjunction of two other query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
      * expressions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
      * @param q1 A query expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
      * @param q2 Another query expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      * @return  The conjunction of the two arguments.  The returned object
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   130
      * will be serialized as an instance of the non-public class
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
      * <a href="../../serialized-form.html#javax.management.AndQueryExp">
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   132
      * javax.management.AndQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     public static QueryExp and(QueryExp q1, QueryExp q2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
         return new AndQueryExp(q1, q2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
      * Returns a query expression that is the disjunction of two other query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
      * expressions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
      * @param q1 A query expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
      * @param q2 Another query expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
      * @return  The disjunction of the two arguments.  The returned object
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   146
      * will be serialized as an instance of the non-public class
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
      * <a href="../../serialized-form.html#javax.management.OrQueryExp">
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   148
      * javax.management.OrQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     public static QueryExp or(QueryExp q1, QueryExp q2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
         return new OrQueryExp(q1, q2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
      * Returns a query expression that represents a "greater than" constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
      * two values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
      * @param v1 A value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
      * @param v2 Another value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
      * @return A "greater than" constraint on the arguments.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   163
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   164
      * <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   165
      * javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
      * to {@link #GT}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     public static QueryExp gt(ValueExp v1, ValueExp v2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
         return new BinaryRelQueryExp(GT, v1, v2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
      * Returns a query expression that represents a "greater than or equal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
      * to" constraint on two values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
      * @param v1 A value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
      * @param v2 Another value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
      * @return A "greater than or equal to" constraint on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
      * arguments.  The returned object will be serialized as an
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   181
      * instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   182
      * <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   183
      * javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
      * to {@link #GE}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     public static QueryExp geq(ValueExp v1, ValueExp v2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
         return new BinaryRelQueryExp(GE, v1, v2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
      * Returns a query expression that represents a "less than or equal to"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
      * constraint on two values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
      * @param v1 A value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
      * @param v2 Another value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
      * @return A "less than or equal to" constraint on the arguments.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
      * The returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   199
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   200
      * <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   201
      * javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
      * to {@link #LE}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     public static QueryExp leq(ValueExp v1, ValueExp v2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
         return new BinaryRelQueryExp(LE, v1, v2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
      * Returns a query expression that represents a "less than" constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
      * two values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
      * @param v1 A value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
      * @param v2 Another value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
      * @return A "less than" constraint on the arguments.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   217
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   218
      * <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   219
      * javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
      * to {@link #LT}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     public static QueryExp lt(ValueExp v1, ValueExp v2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
         return new BinaryRelQueryExp(LT, v1, v2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
      * Returns a query expression that represents an equality constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
      * two values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
      * @param v1 A value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
      * @param v2 Another value expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
      * @return A "equal to" constraint on the arguments.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   235
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   236
      * <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   237
      * javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
      * to {@link #EQ}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     public static QueryExp eq(ValueExp v1, ValueExp v2)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
         return new BinaryRelQueryExp(EQ, v1, v2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
      * Returns a query expression that represents the constraint that one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
      * value is between two other values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
      * @param v1 A value expression that is "between" v2 and v3.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
      * @param v2 Value expression that represents a boundary of the constraint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
      * @param v3 Value expression that represents a boundary of the constraint.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
      * @return The constraint that v1 lies between v2 and v3.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   254
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   255
      * <a href="../../serialized-form.html#javax.management.BetweenQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   256
      * javax.management.BetweenQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     public static QueryExp between(ValueExp v1, ValueExp v2, ValueExp v3) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
         return new BetweenQueryExp(v1, v2, v3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
      * Returns a query expression that represents a matching constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
      * a string argument. The matching syntax is consistent with file globbing:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
      * supports "<code>?</code>", "<code>*</code>", "<code>[</code>",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
      * each of which may be escaped with "<code>\</code>";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
      * character classes may use "<code>!</code>" for negation and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
      * "<code>-</code>" for range.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
      * (<code>*</code> for any character sequence,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
      * <code>?</code> for a single arbitrary character,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
      * <code>[...]</code> for a character sequence).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
      * For example: <code>a*b?c</code> would match a string starting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
      * with the character <code>a</code>, followed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
      * by any number of characters, followed by a <code>b</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
      * any single character, and a <code>c</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
      * @param a An attribute expression
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
      * @param s A string value expression representing a matching constraint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
      * @return A query expression that represents the matching
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
      * constraint on the string argument.  The returned object will
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   282
      * be serialized as an instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   283
      * <a href="../../serialized-form.html#javax.management.MatchQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   284
      * javax.management.MatchQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     public static QueryExp match(AttributeValueExp a, StringValueExp s)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
         return new MatchQueryExp(a, s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     /**
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   291
      * <p>Returns a new attribute expression.  See {@link AttributeValueExp}
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   292
      * for a detailed description of the semantics of the expression.</p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
      *
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 715
diff changeset
   294
      * <p>Evaluating this expression for a given
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 715
diff changeset
   295
      * <code>objectName</code> includes performing {@link
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 715
diff changeset
   296
      * MBeanServer#getAttribute MBeanServer.getAttribute(objectName,
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 715
diff changeset
   297
      * name)}.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 715
diff changeset
   298
      *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
      * @param name The name of the attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
      *
34
2d042367885f 6602310: Extensions to Query API for JMX 2.0
emcmanus
parents: 2
diff changeset
   301
      * @return An attribute expression for the attribute named {@code name}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     public static AttributeValueExp attr(String name)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
         return new AttributeValueExp(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
      * <p>Returns a new qualified attribute expression.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
      * <p>Evaluating this expression for a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
      * <code>objectName</code> includes performing {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
      * MBeanServer#getObjectInstance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
      * MBeanServer.getObjectInstance(objectName)} and {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
      * MBeanServer#getAttribute MBeanServer.getAttribute(objectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
      * name)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
      * @param className The name of the class possessing the attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
      * @param name The name of the attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
      * @return An attribute expression for the attribute named name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
      * The returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   322
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   323
      * <a href="../../serialized-form.html#javax.management.QualifiedAttributeValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   324
      * javax.management.QualifiedAttributeValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     public static AttributeValueExp attr(String className, String name)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
         return new QualifiedAttributeValueExp(className, name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
      * <p>Returns a new class attribute expression which can be used in any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
      * Query call that expects a ValueExp.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
      * <p>Evaluating this expression for a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
      * <code>objectName</code> includes performing {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
      * MBeanServer#getObjectInstance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
      * MBeanServer.getObjectInstance(objectName)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
      * @return A class attribute expression.  The returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
      * will be serialized as an instance of the non-public class
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   341
      * <a href="../../serialized-form.html#javax.management.ClassAttributeValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   342
      * javax.management.ClassAttributeValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     public static AttributeValueExp classattr()  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
         return new ClassAttributeValueExp();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
      * Returns a constraint that is the negation of its argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
      * @param queryExp The constraint to negate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
      * @return A negated constraint.  The returned object will be
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   354
      * serialized as an instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   355
      * <a href="../../serialized-form.html#javax.management.NotQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   356
      * javax.management.NotQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     public static QueryExp not(QueryExp queryExp)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
         return new NotQueryExp(queryExp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
      * Returns an expression constraining a value to be one of an explicit list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
      * @param val A value to be constrained.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
      * @param valueList An array of ValueExps.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
      * @return A QueryExp that represents the constraint.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   370
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   371
      * <a href="../../serialized-form.html#javax.management.InQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   372
      * javax.management.InQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     public static QueryExp in(ValueExp val, ValueExp valueList[])  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
         return new InQueryExp(val, valueList);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
      * Returns a new string expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
      * @param val The string value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
      * @return  A ValueExp object containing the string argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     public static StringValueExp value(String val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
         return new StringValueExp(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
      * Returns a numeric value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
      * @param val An instance of Number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
      * @return A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   397
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   398
      * <a href="../../serialized-form.html#javax.management.NumericValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   399
      * javax.management.NumericValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     public static ValueExp value(Number val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
         return new NumericValueExp(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
      * Returns a numeric value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
      * @param val An int value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
      * @return A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   413
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   414
      * <a href="../../serialized-form.html#javax.management.NumericValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   415
      * javax.management.NumericValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     public static ValueExp value(int val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
         return new NumericValueExp((long) val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
      * Returns a numeric value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
      * @param val A long value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
      * @return A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   429
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   430
      * <a href="../../serialized-form.html#javax.management.NumericValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   431
      * javax.management.NumericValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     public static ValueExp value(long val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
         return new NumericValueExp(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
      * Returns a numeric value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
      * @param val A float value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
      * @return A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   445
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   446
      * <a href="../../serialized-form.html#javax.management.NumericValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   447
      * javax.management.NumericValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     public static ValueExp value(float val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
         return new NumericValueExp((double) val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
      * Returns a numeric value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
      * @param val A double value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
      * @return  A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   461
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   462
      * <a href="../../serialized-form.html#javax.management.NumericValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   463
      * javax.management.NumericValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     public static ValueExp value(double val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
         return new NumericValueExp(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
      * Returns a boolean value expression that can be used in any Query call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
      * that expects a ValueExp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
      * @param val A boolean value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
      * @return A ValueExp object containing the argument.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
      * returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   477
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   478
      * <a href="../../serialized-form.html#javax.management.BooleanValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   479
      * javax.management.BooleanValueExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     public static ValueExp value(boolean val)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
         return new BooleanValueExp(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
      * Returns a binary expression representing the sum of two numeric values,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
      * or the concatenation of two string values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
      * @param value1 The first '+' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
      * @param value2 The second '+' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
      * @return A ValueExp representing the sum or concatenation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
      * the two arguments.  The returned object will be serialized as
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   494
      * an instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   495
      * <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   496
      * javax.management.BinaryOpValueExp</a> with an {@code op} equal to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
      * {@link #PLUS}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     public static ValueExp plus(ValueExp value1, ValueExp value2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
         return new BinaryOpValueExp(PLUS, value1, value2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
      * Returns a binary expression representing the product of two numeric values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
      * @param value1 The first '*' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
      * @param value2 The second '*' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
      * @return A ValueExp representing the product.  The returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
      * object will be serialized as an instance of the non-public
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   512
      * class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   513
      * <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   514
      * javax.management.BinaryOpValueExp</a> with an {@code op} equal to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
      * {@link #TIMES}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     public static ValueExp times(ValueExp value1,ValueExp value2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
         return new BinaryOpValueExp(TIMES, value1, value2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
      * Returns a binary expression representing the difference between two numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
      * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
      * @param value1 The first '-' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
      * @param value2 The second '-' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
      * @return A ValueExp representing the difference between two
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
      * arguments.  The returned object will be serialized as an
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   530
      * instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   531
      * <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   532
      * javax.management.BinaryOpValueExp</a> with an {@code op} equal to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
      * {@link #MINUS}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     public static ValueExp minus(ValueExp value1, ValueExp value2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
         return new BinaryOpValueExp(MINUS, value1, value2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
      * Returns a binary expression representing the quotient of two numeric
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
      * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
      * @param value1 The first '/' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
      * @param value2 The second '/' operand.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
      * @return A ValueExp representing the quotient of two arguments.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
      * The returned object will be serialized as an instance of the
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   548
      * non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   549
      * <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   550
      * javax.management.BinaryOpValueExp</a> with an {@code op} equal to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
      * {@link #DIV}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     public static ValueExp div(ValueExp value1, ValueExp value2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
         return new BinaryOpValueExp(DIV, value1, value2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
      * Returns a query expression that represents a matching constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
      * a string argument. The value must start with the given literal string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
      * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
      * @param a An attribute expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
      * @param s A string value expression representing the beginning of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
      * string value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
      * @return The constraint that a matches s.  The returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
      * will be serialized as an instance of the non-public class
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   568
      *
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   569
      * <a href="../../serialized-form.html#javax.management.MatchQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   570
      * javax.management.MatchQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     public static QueryExp initialSubString(AttributeValueExp a, StringValueExp s)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
         return new MatchQueryExp(a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
             new StringValueExp(escapeString(s.getValue()) + "*"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
      * Returns a query expression that represents a matching constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
      * a string argument. The value must contain the given literal string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
      * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
      * @param a An attribute expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
      * @param s A string value expression representing the substring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
      * @return The constraint that a matches s.  The returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
      * will be serialized as an instance of the non-public class
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   587
      *
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   588
      * <a href="../../serialized-form.html#javax.management.MatchQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   589
      * javax.management.MatchQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     public static QueryExp anySubString(AttributeValueExp a, StringValueExp s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
         return new MatchQueryExp(a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
             new StringValueExp("*" + escapeString(s.getValue()) + "*"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
      * Returns a query expression that represents a matching constraint on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
      * a string argument. The value must end with the given literal string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
      * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
      * @param a An attribute expression.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
      * @param s A string value expression representing the end of the string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
      * value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
      * @return The constraint that a matches s.  The returned object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
      * will be serialized as an instance of the non-public class
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   607
      *
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   608
      * <a href="../../serialized-form.html#javax.management.MatchQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   609
      * javax.management.MatchQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     public static QueryExp finalSubString(AttributeValueExp a, StringValueExp s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
         return new MatchQueryExp(a,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
             new StringValueExp("*" + escapeString(s.getValue())));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
      * Returns a query expression that represents an inheritance constraint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
      * on an MBean class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
      * <p>Example: to find MBeans that are instances of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
      * {@link NotificationBroadcaster}, use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
      * {@code Query.isInstanceOf(Query.value(NotificationBroadcaster.class.getName()))}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
      * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
      * <p>Evaluating this expression for a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
      * <code>objectName</code> includes performing {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
      * MBeanServer#isInstanceOf MBeanServer.isInstanceOf(objectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
      * ((StringValueExp)classNameValue.apply(objectName)).getValue()}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
      * @param classNameValue The {@link StringValueExp} returning the name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
      *        of the class of which selected MBeans should be instances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
      * @return a query expression that represents an inheritance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
      * constraint on an MBean class.  The returned object will be
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   632
      * serialized as an instance of the non-public class
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   633
      * <a href="../../serialized-form.html#javax.management.InstanceOfQueryExp">
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   634
      * javax.management.InstanceOfQueryExp</a>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
      * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     public static QueryExp isInstanceOf(StringValueExp classNameValue) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
        return new InstanceOfQueryExp(classNameValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
      * Utility method to escape strings used with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
      * Query.{initial|any|final}SubString() methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     private static String escapeString(String s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
         if (s == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
             return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
         s = s.replace("\\", "\\\\");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
         s = s.replace("*", "\\*");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
         s = s.replace("?", "\\?");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
         s = s.replace("[", "\\[");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
         return s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
 }