javax.management
Class Query

java.lang.Object
  extended byjavax.management.Query

public class Query
extends Object

This class is a factory for constructing queries.

REVIEW: Full explanation. See the spec for now for what it's worth.

Version:
$Revision: 1.2.8.2 $
Author:
Adrian Brock.

Field Summary
static int DIV
          Divide expression
static int EQ
          Equals expression
static int GE
          Greater than or equals expression
static int GT
          Greater than expression
static int LE
          Less than or equals expression
static int LT
          Less than expression
static int MINUS
          Minus expression
static int PLUS
          Plus expression
static int TIMES
          Times expression
 
Constructor Summary
Query()
          Construct a new Query
 
Method Summary
static QueryExp and(QueryExp first, QueryExp second)
          And Query expression.
static QueryExp anySubString(AttributeValueExp attr, StringValueExp string)
          Tests an attribute contains a string as a subset.
static AttributeValueExp attr(String value)
          An attribute expression
static AttributeValueExp attr(String className, String value)
          An attribute expression restricted to a specific class
static QueryExp between(ValueExp test, ValueExp lower, ValueExp higher)
          Tests a value is between two other values.
static AttributeValueExp classattr()
          What is this?
static ValueExp div(ValueExp first, ValueExp second)
          An expression that divides the first expression by the second
static QueryExp eq(ValueExp first, ValueExp second)
          Equals Comparison.
static QueryExp finalSubString(AttributeValueExp attr, StringValueExp string)
          Tests an attribute ends with a string as a subset.
static QueryExp geq(ValueExp first, ValueExp second)
          Greater than or Equals Comparison.
static QueryExp gt(ValueExp first, ValueExp second)
          Greater than.
static QueryExp in(ValueExp test, ValueExp[] list)
          Tests a value is in one of the listed values.
static QueryExp initialSubString(AttributeValueExp attr, StringValueExp string)
          Tests an attribute starts with a string as a subset.
static QueryExp leq(ValueExp first, ValueExp second)
          Less than or equal.
static QueryExp lt(ValueExp first, ValueExp second)
          Less than.
static QueryExp match(AttributeValueExp attr, StringValueExp string)
          Tests an attribute equals a string value.
static ValueExp minus(ValueExp first, ValueExp second)
          An expression that subtracts the second expression from the first
static QueryExp not(QueryExp expression)
          Not Query expression.
static QueryExp or(QueryExp first, QueryExp second)
          Or Query expression.
static ValueExp plus(ValueExp first, ValueExp second)
          An expression that adds the second expression to the first
static ValueExp times(ValueExp first, ValueExp second)
          An expression that multiplies the first expression by the second
static ValueExp value(boolean value)
          Create a boolean value expression for use in a Query.
static ValueExp value(double value)
          Create a double value expression for use in a Query.
static ValueExp value(float value)
          Create a float value expression for use in a Query.
static ValueExp value(int value)
          Create an integer value expression for use in a Query.
static ValueExp value(long value)
          Create a long value expression for use in a Query.
static ValueExp value(Number value)
          Create a number value expression for use in a Query.
static StringValueExp value(String value)
          Create a string value expression for use in a Query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIV

public static final int DIV
Divide expression

See Also:
Constant Field Values

EQ

public static final int EQ
Equals expression

See Also:
Constant Field Values

GE

public static final int GE
Greater than or equals expression

See Also:
Constant Field Values

GT

public static final int GT
Greater than expression

See Also:
Constant Field Values

LE

public static final int LE
Less than or equals expression

See Also:
Constant Field Values

LT

public static final int LT
Less than expression

See Also:
Constant Field Values

MINUS

public static final int MINUS
Minus expression

See Also:
Constant Field Values

PLUS

public static final int PLUS
Plus expression

See Also:
Constant Field Values

TIMES

public static final int TIMES
Times expression

See Also:
Constant Field Values
Constructor Detail

Query

public Query()
Construct a new Query

Method Detail

and

public static QueryExp and(QueryExp first,
                           QueryExp second)
And Query expression. Return true only when both expressions are true.

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

anySubString

public static QueryExp anySubString(AttributeValueExp attr,
                                    StringValueExp string)
Tests an attribute contains a string as a subset. Return true when this is the case, false otherwise.

Parameters:
attr - the attribute
string - the string
Returns:
the expression

attr

public static AttributeValueExp attr(String value)
An attribute expression

Parameters:
value - the name of the attribute
Returns:
the expression

attr

public static AttributeValueExp attr(String className,
                                     String value)
An attribute expression restricted to a specific class

Parameters:
className - the name of the class
value - the name of the attribute
Returns:
the expression

between

public static QueryExp between(ValueExp test,
                               ValueExp lower,
                               ValueExp higher)
Tests a value is between two other values. Returns true when this is case, false otherwise.

Parameters:
test - the value to test
lower - the lower bound
higher - the higer bound
Returns:
the expression

classattr

public static AttributeValueExp classattr()
What is this?

Returns:
the expression

div

public static ValueExp div(ValueExp first,
                           ValueExp second)
An expression that divides the first expression by the second

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

eq

public static QueryExp eq(ValueExp first,
                          ValueExp second)
Equals Comparison.

Parameters:
first - the first expression
second - the second expression
Returns:
true when first equals second

finalSubString

public static QueryExp finalSubString(AttributeValueExp attr,
                                      StringValueExp string)
Tests an attribute ends with a string as a subset. Return true when this is the case, false otherwise.

Parameters:
attr - the attribute
string - the string
Returns:
the expression

geq

public static QueryExp geq(ValueExp first,
                           ValueExp second)
Greater than or Equals Comparison.

Parameters:
first - the first expression
second - the second expression
Returns:
true when first >= second

gt

public static QueryExp gt(ValueExp first,
                          ValueExp second)
Greater than.

Parameters:
first - the first expression
second - the second expression
Returns:
true when first > second

in

public static QueryExp in(ValueExp test,
                          ValueExp[] list)
Tests a value is in one of the listed values. Returns true when this is case, false otherwise.

Parameters:
test - the value to test
list - an array of values
Returns:
the expression

initialSubString

public static QueryExp initialSubString(AttributeValueExp attr,
                                        StringValueExp string)
Tests an attribute starts with a string as a subset. Return true when this is the case, false otherwise.

Parameters:
attr - the attribute
string - the string
Returns:
the expression

leq

public static QueryExp leq(ValueExp first,
                           ValueExp second)
Less than or equal.

Parameters:
first - the first expression
second - the second expression
Returns:
true when first <= second

lt

public static QueryExp lt(ValueExp first,
                          ValueExp second)
Less than.

Parameters:
first - the first expression
second - the second expression
Returns:
true when first < second

match

public static QueryExp match(AttributeValueExp attr,
                             StringValueExp string)
Tests an attribute equals a string value. Return true when this is the case, false otherwise.

Parameters:
attr - the attribute
string - the string
Returns:
the expression

minus

public static ValueExp minus(ValueExp first,
                             ValueExp second)
An expression that subtracts the second expression from the first

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

not

public static QueryExp not(QueryExp expression)
Not Query expression. Return true only when expression is false.

Parameters:
expression - the expression to negate
Returns:
the expression

or

public static QueryExp or(QueryExp first,
                          QueryExp second)
Or Query expression. Return true when either expression is true.

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

plus

public static ValueExp plus(ValueExp first,
                            ValueExp second)
An expression that adds the second expression to the first

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

times

public static ValueExp times(ValueExp first,
                             ValueExp second)
An expression that multiplies the first expression by the second

Parameters:
first - the first expression
second - the second expression
Returns:
the expression

value

public static ValueExp value(boolean value)
Create a boolean value expression for use in a Query.

Returns:
the expression

value

public static ValueExp value(double value)
Create a double value expression for use in a Query.

Returns:
the expression

value

public static ValueExp value(float value)
Create a float value expression for use in a Query.

Returns:
the expression

value

public static ValueExp value(int value)
Create an integer value expression for use in a Query.

Returns:
the expression

value

public static ValueExp value(long value)
Create a long value expression for use in a Query.

Returns:
the expression

value

public static ValueExp value(Number value)
Create a number value expression for use in a Query.

Returns:
the expression

value

public static StringValueExp value(String value)
Create a string value expression for use in a Query.

Returns:
the expression


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.