javax.slee.profile.query.And Maven / Gradle / Ivy
package javax.slee.profile.query; /** * The
. * @throws NullPointerException ifAnd
class is a composite dynamic query expression that * successfully matches with a profile only if all nested query expressions * also match with the profile. */ public final class And extends CompositeQueryExpression { /** * Create anAnd
query expression initially populated with the two * specified query expressions. * @param expr1 the first query expression to add. * @param expr2 the second query expression to add. * @throws NullPointerException if either argument isnull
. */ public And(QueryExpression expr1, QueryExpression expr2) { add(expr1); add(expr2); } /** * Create anAnd
query expression initially populated with the * expressions contained in the specified array. * @param exprs the query expressions to add. * @throws NullPointerException ifexprs
isnull
or * containsnull
elements. * @throws IllegalArgumentException if the length ofexprs
is * less than 2. */ public And(QueryExpression[] exprs) { if (exprs == null) throw new NullPointerException("exprs is null"); if (exprs.length < 2) throw new IllegalArgumentException("length of exprs must be at least 2"); for (int i=0; ithis expr
isnull
. * @throws IllegalArgumentException if adding the query expression to this * composite expression would generate a cyclic expression. */ public And and(QueryExpression expr) throws NullPointerException, IllegalArgumentException { add(expr); return this; } // protected // javadoc copied from parent protected void toString(StringBuffer buf) { QueryExpression[] exprs = getExpressions(); for (int i=0; i0) buf.append(" && "); buf.append('('); exprs[i].toString(buf); buf.append(')'); } } }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy