Examples of Constraint


Examples of com.mobixess.jodb.soda.api.Constraint

            sessionContainer.close();
            sessionContainer = getContainerForFile(testFile);
        }
       
        query = sessionContainer.query();
        Constraint constraint = query.descend("_val3").constrain(ObjectB.class);
        query.descend("_val2").constrain(short.class).or(constraint);
        list = query.execute();
        if(list.size()!=2){
            throw new RuntimeException();
        }
View Full Code Here

Examples of com.mobixess.jodb.soda.api.Constraint

            sessionContainer.close();
            sessionContainer = getContainerForFile(testFile);
        }
       
        query = sessionContainer.query();
        Constraint constraint = query.descend("_val2").constrain(new Byte((byte)3));
        query.descend("_val2").constrain(new Byte((byte)0)).or(constraint);
        list = query.execute();
        if(list.size()!=2){
            throw new RuntimeException();
        }
View Full Code Here

Examples of com.mobixess.jodb.soda.api.Constraint

            sessionContainer.close();
            sessionContainer = getContainerForFile(testFile);
        }
       
        query = sessionContainer.query();
        Constraint constraint = query.descend("_val1").constrain((byte)2).smaller();
        query.descend("_val2").constrain(2).greater().or(constraint);
        list = query.execute();
        if(list.size()!=2){
            throw new RuntimeException();
        }
View Full Code Here

Examples of com.mockobjects.constraint.Constraint

        MuleEvent event = getTestEvent("UncaughtEvent");
        strategy.setEndpoint((OutboundEndpoint) endpoint.proxy());

        endpoint.expectAndReturn("getTransformers", CollectionUtils.singletonList(new TestEventTransformer()));
        endpoint.expectAndReturn("getTransformers", CollectionUtils.singletonList(new TestEventTransformer()));
        endpoint.expect("process", new Constraint()
        {
            public boolean eval(Object object)
            {
                if (object instanceof MuleEvent)
                {
View Full Code Here

Examples of com.sun.enterprise.tools.common.validation.constraints.Constraint

     */
    private Collection validate(String value, ArrayList constraints,
            String name){
        ArrayList failed_constrains = new ArrayList();
        int size = constraints.size();
        Constraint constraint =  null;
        for(int i=0; i<size; i++) {
            constraint = (Constraint)constraints.get(i);
            failed_constrains.addAll(constraint.match(value, name));
        }
        return failed_constrains;
    }
View Full Code Here

Examples of com.sun.jdo.spi.persistence.support.sqlstore.sql.constraint.Constraint

        super();

        this.pcClass = pcClass;
        this.config = config;
        fields = new ArrayList();
        constraint = new Constraint();
    }
View Full Code Here

Examples of com.trikke.data.Constraint

    constraintiter = table.constraints.iterator();

    while ( constraintiter.hasNext() )
    {
      Constraint constraint = constraintiter.next();
      if ( constraint.type.equals( Constraint.Type.UNIQUE ) )
      {
        final String[] fields = SqlUtil.getFieldsFromConstraint( constraint );
        for ( int i = 0; i < fields.length; i++ )
        {
View Full Code Here

Examples of com.volantis.mcs.themes.constraints.Constraint

            actionsCombo.select(0);
            updateValueEnabled();
        } else {
            AttributeSelector newSelector = (AttributeSelector) newValue;
            attributeText.setText(newSelector.getName());
            Constraint constraint = newSelector.getConstraint();
            valueText.setText(constraint.getValue());
            int selectedAction = -1;
            final AttributeSelectorActionEnum action =
                    AttributeSelectorActionEnum.
                    getAttributeSelectorActionEnum(constraint);
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.Constraint

                    }
                }
            } else if (relationName.equals(CFRelation.PL_Relation)) {//Լ��ģ���ڹ�ϵ�ı䴦��
                if (!oldEFID.equals(newEFID)) {//��ϵ�������˷����仯

                    Constraint c = constraintModel.getConstraint(oldSFID);

                    Feature newF = featureModel.getFeature(newEFID);

                    String relationID = (String) focusConnection.getAttribute("id");
                    CFRelation oldR = constraintModel.getCFRelation(relationID);
                    CFRModifier modifier = oldR.getModifier();
                    boolean isSource = oldR.isSource();
                    constraintModelEditor.removeCFRelation(relationID);

                    //����id��figure��ӳ���
                    if (idToFigureMap != null) {
                        idToFigureMap.remove(relationID, focusConnection);
                    }

                    CFRelation plRelation = plRelation = constraintModelEditor.addCFRelation(relationID, newF, c, isSource, modifier);

                    if (plRelation != null) {
                        focusConnection.setAttribute("id", plRelation.getID());

                        //����id��figure��ӳ���
                        if (idToFigureMap != null) {
                            idToFigureMap.add(plRelation.getID(), focusConnection);
                        }
                    }
                } else if (!oldSFID.equals(newSFID)) { //��ϵ��Լ���˷����仯
                    Constraint cNew = constraintModel.getConstraint(newSFID);

                    Feature newF = featureModel.getFeature(newEFID);

                    String relationID = (String) focusConnection.getAttribute("id");
                    CFRModifier modifier = constraintModel.getCFRelation(relationID).getModifier();
                    constraintModelEditor.removeCFRelation(relationID);

                    //����id��figure��ӳ���
                    if (idToFigureMap != null) {
                        idToFigureMap.remove(relationID, focusConnection);
                    }

                    ConstraintFigure cf = (ConstraintFigure) newStartFigure;
                    CFRelation plRelation = null;

                    if (cf instanceof PLFigure) {
                        int direction = focusConnection.getStartConnector().getDirection();

                        if (direction == Connector.WEST_DIRECTION || direction == Connector.NORTH_DIRECTION) {
                            plRelation = constraintModelEditor.addCFRelation(relationID, newF, cNew, true, modifier);
                        } else if (direction == Connector.EAST_DIRECTION || direction == Connector.SOUTH_DIRECTION) {
                            plRelation = constraintModelEditor.addCFRelation(relationID, newF, cNew, false, modifier);
                        } else {
                            assert false;
                        }

                    } else if (cf instanceof GroupConstraintFigure) {
                        GroupConstraintFigure gcf = (GroupConstraintFigure) cf;

                        Integer pp = (Integer) gcf.getAttribute(GroupConstraintFigure.PortPosition);
                        int value = pp.intValue();
                        boolean isSource = false;

                        switch (value) {
                            case SwingConstants.NORTH:
                            case SwingConstants.WEST:
                                isSource = true;
                                break;
                            case SwingConstants.EAST:
                            case SwingConstants.SOUTH:
                                isSource = false;
                                break;
                            default:
                                assert false;
                                break;
                        }

                        plRelation = constraintModelEditor.addCFRelation(relationID, newF, cNew, isSource, modifier);

                    } else if (cf instanceof VPConstraintFigure) {
                        int direction = focusConnection.getStartConnector().getDirection();

                        if (direction == Connector.WEST_DIRECTION || direction == Connector.NORTH_DIRECTION) {
                            plRelation = constraintModelEditor.addCFRelation(relationID, newF, cNew, true, modifier);
                        } else if (direction == Connector.EAST_DIRECTION || direction == Connector.SOUTH_DIRECTION) {
                            plRelation = constraintModelEditor.addCFRelation(relationID, newF, cNew, false, modifier);
                        } else {
                            assert false;
                        }
                    } else {
                        assert false;
                    }

                    if (plRelation != null) {
                        focusConnection.setAttribute("id", plRelation.getID());

                        //����id��figure��ӳ���
                        if (idToFigureMap != null) {
                            idToFigureMap.add(plRelation.getID(), focusConnection);
                        }
                    }

                } else
                if (oldSFID.equals(newSFID) && (oldStartConnector != focusConnection.getStartConnector())) {//��ϵԼ���˵������ӷ����仯

                    String relationIDOld = (String) focusConnection.getAttribute("id");

                    CFRelation plRelationOld = constraintModel.getCFRelation(relationIDOld);

                    boolean isSource = plRelationOld.isSource();

                    Feature feature = plRelationOld.getFeature();
                    Constraint plc = (Constraint) plRelationOld.getConstraint();

                    CFRModifier modifier = constraintModel.getCFRelation(relationIDOld).getModifier();
                    constraintModelEditor.removeCFRelation(relationIDOld);

                    //����id��figure��ӳ���
View Full Code Here

Examples of de.timefinder.data.algo.Constraint

    public Collection readConstraints(Element constrElement) {
        List<Constraint> res = new ArrayList();
        for (Object obj : constrElement.elements()) {
            Element element = (Element) obj;
            Constraint constraint = null;

            if (RasterConstraint.class.getSimpleName().equals(element.getName())) {
                BitSet bs = getResult(obj, BitSet.class, element);
                int length = Integer.parseInt(element.attributeValue("length"));
                constraint = new RasterConstraint(new WeekRasterImpl(
                        new BitRasterImpl(bs, length)));

            } else if (EventOrderConstraint.class.getSimpleName().equals(element.getName())) {
                UnsupportedOperationException excFirstEl = new UnsupportedOperationException(
                        "First element in eventOrderConstraint must be the event!" + element.getPath());
                for (Object eocObj : element.elements()) {
                    Element eocEl = (Element) eocObj;
                    if ("event".equals(eocEl.getName())) {
                        Event ev = getObject(getRef(eocEl), Event.class);
                        constraint = new EventOrderConstraint(ev);
                    } else if ("beforeEvent".equals(eocEl.getName())) {
                        if (constraint == null)
                            throw excFirstEl;
                        Event ev = getObject(getRef(eocEl), Event.class);
                        ((EventOrderConstraint) constraint).addBefore(ev);
                    } else if ("followsEvent".equals(eocEl.getName())) {
                        if (constraint == null)
                            throw excFirstEl;
                        Event ev = getObject(getRef(eocEl), Event.class);
                        ((EventOrderConstraint) constraint).addFollow(ev);
                    } else
                        throw new UnsupportedOperationException("Element not supported in eventOrderConstraint:"
                                + eocEl.getPath());
                }
            } else if (PersonITCRasterConstraint.class.getSimpleName().equals(element.getName())) {
                Person p = getObject(getRef(element.element("person")), Person.class);
                constraint = new PersonITCRasterConstraint(p, settings);

            } else if (MinGapsConstraint.class.getSimpleName().equals(element.getName())) {
                constraint = new MinGapsConstraint(settings,
                        readCollection(element, Event.class));
                ((MinGapsConstraint) constraint).setCountEarly(
                        Boolean.parseBoolean(element.attributeValue("countEarly")));

            } else if (DifferentDayConstraint.class.getSimpleName().equals(element.getName())) {
                constraint = new DifferentDayConstraint(settings,
                        readCollection(element, Event.class));

            } else
                throw new UnsupportedOperationException("Constraint not supported:" + element.getName());

            if (constraint == null)
                throw new IllegalStateException("Couldn't find a constraint in path:" + element.getPath());
            float weight = Float.parseFloat(element.attributeValue("weight"));
            constraint.setWeight(weight);
            res.add(constraint);
        }
        return res;
    }
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.