All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.jaw.reference.query.Query
java.lang.Object
|
+----com.sun.jaw.reference.query.Query
- public class Query
- extends Object
This class supports construction of object query constraints.
The static methods provided return query expressions that may
be used in listing and enumerating managed objects. Individual
methods for constructing constraints only allow appropriate types as
arguments. Composition of calls can construct arbitrary
nestings of constraints.
An example follows:
QueryExp exp = Query.and(Query.gt(Query.attr("age"), Query.value(5)),
Query.match(Query.attr("name"),
Query.value("G*ling")));
- See Also:
- AttributeExp, StringValueExp, QueryExp, ValueExp
-
DIV
-
-
EQ
-
-
GE
-
-
GT
-
-
LE
-
-
LT
-
-
MINUS
-
-
PLUS
-
-
TIMES
-
-
Query()
-
-
and(QueryExp, QueryExp)
- Returns a query expression that is the conjunction of two other
query expressions.
-
anySubstring(AttributeExp, StringValueExp)
- Returns a query expression that represents a matching constraint
on a string argument.
-
attr(String)
- Returns a new attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
-
attr(String, int)
- Returns a new indexed attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
-
attr(String, String)
- Returns a new qualified attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
-
attr(String, String, int)
- Returns a new qualified attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
-
between(ValueExp, ValueExp, ValueExp)
- Returns a query expression that represents the constraint
that one value lies between two other values.
-
div(ValueExp, ValueExp)
- Return a binary expression representing the quotient of two
numeric values.
-
eq(ValueExp, ValueExp)
- Returns a query expression that represents an equality
constraint on two values.
-
finalSubstring(AttributeExp, StringValueExp)
- Returns a query expression that represents a matching constraint
on a string argument.
-
geq(ValueExp, ValueExp)
- Returns a query expression that represents a "greater than or equal to"
constraint on two values.
-
getClassVersion()
- Returns the version of this class.
-
gt(ValueExp, ValueExp)
- Returns a query expression that represents a "greater than"
constraint on two values.
-
in(ValueExp, ValueExp[])
- Returns an expression constraining a value to be one of
an explicit list.
-
initialSubstring(AttributeExp, StringValueExp)
- Returns a query expression that represents a matching constraint
on a string argument.
-
leq(ValueExp, ValueExp)
- Returns a query expression that represents a "less than or equal to"
constraint on two values.
-
lt(ValueExp, ValueExp)
- Returns a query expression that represents a "less than"
constraint on two values.
-
match(AttributeExp, StringValueExp)
- Returns a query expression that represents a matching constraint
on a string argument.
-
minus(ValueExp, ValueExp)
- Return a binary expression representing the difference of two
numeric values.
-
not(QueryExp)
- Returns a constraint that is the negation of its argument.
-
or(QueryExp, QueryExp)
- Returns a query expression that is the disjunction of two other
query expressions.
-
plus(ValueExp, ValueExp)
- Returns a binary expression representing the sum of two
numeric values or the concatenation of two string values.
-
times(ValueExp, ValueExp)
- Return a binary expression representing the product of two
value expressions.
-
value(boolean)
- Returns a boolean value expression that can be used in any
Query call that expects a ValueExp.
-
value(double)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
-
value(float)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
-
value(int)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
-
value(long)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
-
value(Number)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
-
value(String)
- Returns a new string expression which can be used in any
Query call that expects a StringValueExp
or a ValueExp.
GT
public static final int GT
LT
public static final int LT
GE
public static final int GE
LE
public static final int LE
EQ
public static final int EQ
PLUS
public static final int PLUS
MINUS
public static final int MINUS
TIMES
public static final int TIMES
DIV
public static final int DIV
Query
public Query()
getClassVersion
public String getClassVersion()
- Returns the version of this class.
- Returns:
- a string representation of the version of this class.
and
public static QueryExp and(QueryExp q1,
QueryExp q2)
- Returns a query expression that is the conjunction of two other
query expressions.
- Parameters:
- q1 - A query expression.
- q2 - Another query expression.
- Returns:
- The conjunction of the two query expressions q1
and q2.
or
public static QueryExp or(QueryExp q1,
QueryExp q2)
- Returns a query expression that is the disjunction of two other
query expressions.
- Parameters:
- q1 - A query expression.
- q2 - Another query expression.
- Returns:
- The disjunction of the two query expressions q1
and q2.
gt
public static QueryExp gt(ValueExp v1,
ValueExp v2)
- Returns a query expression that represents a "greater than"
constraint on two values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- Returns:
- A "greater than" constraint on the two value expressions
v1 and v2.
geq
public static QueryExp geq(ValueExp v1,
ValueExp v2)
- Returns a query expression that represents a "greater than or equal to"
constraint on two values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- Returns:
- A "greater than or equal to" constraint on the two value
expressions v1 and v2.
leq
public static QueryExp leq(ValueExp v1,
ValueExp v2)
- Returns a query expression that represents a "less than or equal to"
constraint on two values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- Returns:
- A "less than or equal to" constraint on the two value
expressions v1 and v2.
lt
public static QueryExp lt(ValueExp v1,
ValueExp v2)
- Returns a query expression that represents a "less than"
constraint on two values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- Returns:
- A "less than" constraint on the two value
expressions v1 and v2.
eq
public static QueryExp eq(ValueExp v1,
ValueExp v2)
- Returns a query expression that represents an equality
constraint on two values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- Returns:
- An equality constraint on the two value
expressions v1 and v2.
between
public static QueryExp between(ValueExp v1,
ValueExp v2,
ValueExp v3)
- Returns a query expression that represents the constraint
that one value lies between two other values.
- Parameters:
- v1 - A value expression.
- v2 - Another value expression.
- v3 - Another value expression.
- Returns:
- The constraint that v1 lies between
v2 and v3.
match
public static QueryExp match(AttributeExp a1,
StringValueExp s)
- Returns a query expression that represents a matching constraint
on a string argument. The matching syntax is consistent with
file globbing:
* for any character sequence
? for a single arbitrary character.
For example: a*b?c would match any number of
as followed by a b, any single
character, and a c.
- Parameters:
- a - An attribute expression.
- s - A string value expression representing a
matching constraint.
- Returns:
- The constraint that a matches s.
initialSubstring
public static QueryExp initialSubstring(AttributeExp a1,
StringValueExp s)
- Returns a query expression that represents a matching constraint
on a string argument. The value must start with the given string value.
- Parameters:
- a - An attribute expression.
- s - A string value expression representing the
beginning of the string value.
- Returns:
- The constraint that a matches s.
anySubstring
public static QueryExp anySubstring(AttributeExp a1,
StringValueExp s)
- Returns a query expression that represents a matching constraint
on a string argument. The value must contain the given string value.
- Parameters:
- a - An attribute expression.
- s - A string value expression representing the
"middle" of the string value.
- Returns:
- The constraint that a matches s.
finalSubstring
public static QueryExp finalSubstring(AttributeExp a1,
StringValueExp s)
- Returns a query expression that represents a matching constraint
on a string argument. The value must end with the given string value.
- Parameters:
- a - An attribute expression.
- s - A string value expression representing the
end of the string value.
- Returns:
- The constraint that a matches s.
attr
public static AttributeExp attr(String name)
- Returns a new attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
- Parameters:
- name - The name of the attribute.
- Returns:
- An attribute expression for the attribute named
name.
attr
public static QualifiedAttributeExp attr(String className,
String name)
- Returns a new qualified attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
- Parameters:
- class - The class possessing the attribute.
- name - The name of the attribute.
- Returns:
- An attribute expression for the attribute named
name.
attr
public static IndexedAttributeExp attr(String name,
int index)
- Returns a new indexed attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
- Parameters:
- name - The name of the attribute.
- Returns:
- An attribute expression for the attribute named
name.
attr
public static QualifiedIndexedAttributeExp attr(String className,
String name,
int index)
- Returns a new qualified attribute expression which can be used in any
Query call that expects an
AttributeExp or a
ValueExp.
- Parameters:
- class - The class possessing the attribute.
- name - The name of the attribute.
- Returns:
- An attribute expression for the attribute named
name.
not
public static NotQueryExp not(QueryExp queryExp)
- Returns a constraint that is the negation of its argument.
- Parameters:
- queryExp - The constraint to be negated.
- Returns:
- A negated constraint.
in
public static InQueryExp in(ValueExp val,
ValueExp valueList[])
- Returns an expression constraining a value to be one of
an explicit list.
- Parameters:
- val - A value to be constrained.
- valueList - An array of ValueExps.
- Returns:
- An
InQueryExp that represents the
constraint.
value
public static StringValueExp value(String val)
- Returns a new string expression which can be used in any
Query call that expects a StringValueExp
or a ValueExp.
- Parameters:
- val - The string value.
- Returns:
- A
StringValueExp object containing the
string argument.
value
public static ValueExp value(Number val)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - An instance of Number.
- Returns:
- A
NumericValue object containing the argument.
value
public static ValueExp value(int val)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - An integer value.
- Returns:
- A
NumericValue object containing the argument.
value
public static ValueExp value(long val)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - A long value.
- Returns:
- A
NumericValue object containing the argument.
value
public static ValueExp value(float val)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - A floating point value.
- Returns:
- A
NumericValue object containing the argument.
value
public static ValueExp value(double val)
- Returns a numeric value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - A double-precision value.
- Returns:
- A
NumericValue object containing the argument.
value
public static ValueExp value(boolean val)
- Returns a boolean value expression that can be used in any
Query call that expects a ValueExp.
- Parameters:
- val - A boolean value.
- Returns:
- A
NumericValue object containing the argument.
plus
public static BinaryOpExpression plus(ValueExp value1,
ValueExp value2)
- Returns a binary expression representing the sum of two
numeric values or the concatenation of two string values.
- Parameters:
- value1 - An argument to '+'.
- value2 - Another argument to '+'.
- Returns:
- A
BinaryOpExpression representing
the sum or concatenation.
times
public static BinaryOpExpression times(ValueExp value1,
ValueExp value2)
- Return a binary expression representing the product of two
value expressions.
- Parameters:
- value1 - An argument to '*'.
- value2 - Another argument to '*'.
- Returns:
- A
BinaryOpExpression representing
the product.
minus
public static BinaryOpExpression minus(ValueExp value1,
ValueExp value2)
- Return a binary expression representing the difference of two
numeric values.
- Parameters:
- value1 - An argument to '-'.
- value2 - Another argument to '-'.
- Returns:
- A
BinaryOpExpression representing
the difference.
div
public static BinaryOpExpression div(ValueExp value1,
ValueExp value2)
- Return a binary expression representing the quotient of two
numeric values.
- Parameters:
- value1 - An argument to '/'.
- value2 - Another argument to '/'.
- Returns:
- A
BinaryOpExpression representing
the quotient.
All Packages Class Hierarchy This Package Previous Next Index