Examples of Constraint


Examples of edu.cmu.cs.fusion.constraint.Constraint

    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
    trigger = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    req = new RelationshipPredicate(utils.getRelation(1), new SpecVar[] {utils.getVar(1), utils.getVar(2)});
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(1), new SpecVar[] {Constraint.RESULT, utils.getVar(1)}));
   
    cons = new Constraint("", op, trigger, new TruePredicate(), req, effects);
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
    trigger = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    req = new RelationshipPredicate(utils.getRelation(2), new SpecVar[] {utils.getVar(1), utils.getVar(2)});
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(1), new SpecVar[] {Constraint.RESULT, utils.getVar(1)}));
   
    possCons = new Constraint("", op, trigger, new TruePredicate(), req, effects);
   
    aliases = new TestAliasContext();
   
    labels = new ObjectLabel[7];
    labels[0] = new AbstractObjectLabel("0", "Foo");
View Full Code Here

Examples of fr.soleil.lib.flyscan.model.constraints.Constraint

        List<Constraint> constraints = measurementsEntry.getConstraints();

        assertTrue(!constraints.isEmpty());

        Constraint constraint = constraints.get(0);

        assertTrue(constraint instanceof InConstraint);

        InConstraint inConstraint = (InConstraint) constraint;
View Full Code Here

Examples of grails.validation.Constraint

                getConstraint("{val, obj -> return propertyName == 'testString'}"),
                "test");
    }

    public void testConstraintCreation() {
        Constraint validatorConstraint = new ValidatorConstraint();
        assertEquals(ConstrainedProperty.VALIDATOR_CONSTRAINT, validatorConstraint.getName());
        assertTrue(validatorConstraint.supports(TestClass.class));
        assertFalse(validatorConstraint.supports(null));

        validatorConstraint.setOwningClass(TestClass.class);
        validatorConstraint.setPropertyName(PROP_NAME);

        try {
            getConstraint("testString", "Test");
            fail("ValidatorConstraint must throw an exception for non-closure parameter.");
        } catch (IllegalArgumentException iae) {
View Full Code Here

Examples of javax.constraints.Constraint

 
  /**
   * Posts and Returns a constraint: var1 "oper" var2
   */
  public Constraint post(Var var1, String oper, Var var2) {
    Constraint c = add(new Linear(var1, oper, var2));
    c.post();
    return c;
  }
View Full Code Here

Examples of javax.jcr.query.qom.Constraint

        }

        if (rightConstraints.size() < 500) {
            Set<Row> rightRows = new TreeSet<Row>(comparator);
            List<Constraint> localRightContraints = rightConstraints;
            Constraint rightConstraint = Constraints.and(qomFactory,
                    Constraints.or(qomFactory, localRightContraints),
                    csi.getRightConstraint());
            if (ignoreWhereConstraints) {
                rightConstraint = Constraints.or(qomFactory,
                        localRightContraints);
            }
            QueryResult rightResult = execute(null, csi.getSource().getRight(),
                    rightConstraint, null, 0, -1, printIndentation);
            for (Row row : JcrUtils.getRows(rightResult)) {
                rightRows.add(row);
            }
            return rightRows;
        }

        // the 'batch by 500' approach
        Set<Row> rightRows = new TreeSet<Row>(comparator);
        for (int i = 0; i < rightConstraints.size(); i += 500) {
            if (log.isDebugEnabled()) {
                log.debug(genString(printIndentation)
                        + "SQL2 JOIN RIGHT SIDE executing batch # " + i + ".");
            }
            List<Constraint> localRightContraints = rightConstraints.subList(i,
                    Math.min(i + 500, rightConstraints.size()));
            Constraint rightConstraint = Constraints.and(qomFactory,
                    Constraints.or(qomFactory, localRightContraints),
                    csi.getRightConstraint());
            if (ignoreWhereConstraints) {
                rightConstraint = Constraints.or(qomFactory,
                        localRightContraints);
View Full Code Here

Examples of javax.validation.Constraint

        AccessStrategy access, AppendValidation validations) throws InvocationTargetException, IllegalAccessException {

        if (annotation instanceof Valid || annotation instanceof Validate) {
            desc.setCascaded(true);
        } else {
            Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
            if (vcAnno != null) {
                Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
                validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
                applyConstraint(annotation, validatorClasses, null, ClassUtils.primitiveToWrapper((Class<?>) access
                    .getJavaType()), access, validations);
View Full Code Here

Examples of jinngine.physics.constraint.Constraint

    // torso1
    Geometry torso1geometry = new Box(1.7,1,1.7);
    Body torso1 = new Body( "torso1", torso1geometry );
    torso1.setPosition(new Vector3(-5,-11,-25));

    Constraint neck = new UniversalJoint(head,torso1,new Vector3(-5,-10,-25), new Vector3(0,0,1), new Vector3(1,0,0));
    scene.addConstraint(neck);

    // torso2
    Geometry torso2geometry = new Box(1.5,1,1.5);
    Body torso2 = new Body( "torso2", torso2geometry );
View Full Code Here

Examples of linearProgramming.Constraint

   * @param column
   *            the column that should have the same width
   * @return the resulting same-width constraint
   */
  public Constraint hasSameWidthAs(Column column) throws LinearProgrammingException {
    Constraint c = ls.addConstraint(-1, left, 1, right, 1, column.left, -1,
        column.right, OperatorType.EQ, 0);
    c.Owner = this;
    constraints.add(c);
    return c;
  }
View Full Code Here

Examples of net.percederberg.mibble.type.Constraint

     * @param indent         the indentation to use on new lines
     * @param smiVersion     the SMI version to use
     */
    private void printType(MibType type, String indent, int smiVersion) {
        MibType         refType;
        Constraint      refCons;
        Constraint      typeCons;
        SequenceType    seqType;
        SequenceOfType  seqOfType;

        if (type.getReferenceSymbol() != null) {
            os.print(type.getReferenceSymbol().getName());
View Full Code Here

Examples of net.sf.mpxj.planner.schema.Constraint

      plannerTask.setWorkStart(getDateTimeString(mpxjTask.getStart()));

      ConstraintType mpxjConstraintType = mpxjTask.getConstraintType();
      if (mpxjConstraintType != ConstraintType.AS_SOON_AS_POSSIBLE)
      {
         Constraint plannerConstraint = m_factory.createConstraint();
         plannerTask.setConstraint(plannerConstraint);
         if (mpxjConstraintType == ConstraintType.START_NO_EARLIER_THAN)
         {
            plannerConstraint.setType("start-no-earlier-than");
         }
         else
         {
            if (mpxjConstraintType == ConstraintType.MUST_START_ON)
            {
               plannerConstraint.setType("must-start-on");
            }
         }

         plannerConstraint.setTime(getDateTimeString(mpxjTask.getConstraintDate()));
      }

      //
      // Write predecessors
      //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.