@Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) { return new INBinarySearch ( var, vals ) ; } }
/** * @see Annotations#VARIABLE */ @SuppressWarnings("unchecked") public IVariable<T> getVariable() { return (IVariable<T>) getProperty(Annotations.VARIABLE); }
/** * Unit test for {@link OR#OR(IConstraint,IConstraint)} */ public void testConstructor () { BooleanValueExpression eq = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; BooleanValueExpression ne = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; try { assertTrue ( null != new OR ( null, eq ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } catch ( IllegalArgumentException e ) {} try { assertTrue ( null != new OR ( eq, null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } catch ( IllegalArgumentException e ) {} assertTrue ( null != new OR ( eq, ne ) ) ; }
@Override @SuppressWarnings("unchecked") public IValueExpression<X> getValueExpression() { return (IValueExpression<X>) get(0); }
/** * Convenience method to generate a constraint from a value expression. */ @SuppressWarnings("rawtypes") public static IConstraint wrap(final BooleanValueExpression ve) { return new Constraint(ve); }
@Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) { return new INHashMap ( var, vals ) ; } }
/** * Unit test for {@link OR#OR(IConstraint,IConstraint)} */ public void testConstructor () { BooleanValueExpression eq = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; BooleanValueExpression ne = new EQ ( Var.var ( "x" ), Var.var ( "y" ) ) ; try { assertTrue ( null != new OR ( null, eq ) ) ; fail ( "IllegalArgumentException expected, lhs was null" ) ; } catch ( IllegalArgumentException e ) {} try { assertTrue ( null != new OR ( eq, null ) ) ; fail ( "IllegalArgumentException expected, rhs was null" ) ; } catch ( IllegalArgumentException e ) {} assertTrue ( null != new OR ( eq, ne ) ) ; }
@Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) { return new INBinarySearch ( var, vals ) ; } }
/** * @see Annotations#SET */ @SuppressWarnings("unchecked") public IConstant<T>[] getSet() { return (IConstant<T>[]) getProperty(Annotations.SET); }
@SuppressWarnings("unchecked") @Override public IValueExpression<? extends XSDBooleanIV> get(final int i) { return (IValueExpression<? extends XSDBooleanIV>) super.get(i); }
/** * Convenience method to generate a constraint from a value expression. */ @SuppressWarnings("rawtypes") public static IConstraint wrap(final BooleanValueExpression ve) { return new Constraint(ve); }
@Override protected INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) { return new INHashMap ( var, vals ) ; } }
/** * @see Annotations#VARIABLE */ @SuppressWarnings("unchecked") public IVariable<T> getVariable() { return (IVariable<T>) getProperty(Annotations.VARIABLE); }
@SuppressWarnings("unchecked") @Override public IValueExpression<? extends XSDBooleanIV> get(final int i) { return (IValueExpression<? extends XSDBooleanIV>) super.get(i); }
/** * @see Annotations#SET */ @SuppressWarnings("unchecked") public IConstant<T>[] getSet() { return (IConstant<T>[]) getProperty(Annotations.SET); }
@Override @SuppressWarnings("unchecked") public IValueExpression<X> getValueExpression() { return (IValueExpression<X>) get(0); }