Examples of Predicate


Examples of aima.core.logic.fol.parsing.ast.Predicate

    for (Variable v : vars) {
      // Ensure copies of the variables are used.
      terms.add(v.copy());
    }

    return new Literal(new Predicate(alName, terms));
  }
View Full Code Here

Examples of ariba.ui.meta.persistence.Predicate

    }

    public void search ()
    {
        if (errorManager().checkErrorsAndEnableDisplay()) return;
        Predicate pred = Predicate.fromKeyValueMap(_searchMap);
        Context context = MetaContext.currentContext(this);
        String className = (String)context.values().get(UIMeta.KeyClass);
        QuerySpecification spec = new QuerySpecification(className, pred);

        context.push();
View Full Code Here

Examples of cascading.pattern.model.tree.predicate.Predicate

    }

  @Test
  public void testAnd()
    {
    Predicate andPredicate = new AndPredicate( new IsNotMissingPredicate( "var0" ), new EqualsToPredicate( "var1", "value" ) );

    assertTrue( new PredicateEvaluator( expectedFields, andPredicate ).evaluate( tupleEntry ) );
    }
View Full Code Here

Examples of cn.wanghaomiao.xpath.model.Predicate

     * @return
     */
    public Element filter(Element e,Node node) throws NoSuchFunctionException, NoSuchAxisException {
        if (node.getTagName().equals("*")||node.getTagName().equals(e.nodeName())){
            if (node.getPredicate()!=null){
                Predicate p = node.getPredicate();
                if (p.getOpEm()==null){
                    if (p.getValue().matches("\\d+")&&getElIndex(e)==Integer.parseInt(p.getValue())){
                        return e;
                    }else if (p.getValue().endsWith("()")&&(Boolean)callFilterFunc(p.getValue().substring(0,p.getValue().length()-2),e)){
                        return e;
                    }
                    //todo p.value ~= contains(./@href,'renren.com')
                }else {
                    if (p.getLeft().matches("[^/]+\\(\\)")){
                        Object filterRes=p.getOpEm().excute(callFilterFunc(p.getLeft().substring(0,p.getLeft().length()-2),e).toString(),p.getRight());
                        if (filterRes instanceof Boolean && (Boolean) filterRes){
                            return e;
                        }else if(filterRes instanceof Integer && e.siblingIndex()==Integer.parseInt(filterRes.toString())){
                            return e;
                        }
                    }else if (p.getLeft().startsWith("@")){
                        String lValue = e.attr(p.getLeft().substring(1));
                        Object filterRes = p.getOpEm().excute(lValue,p.getRight());
                        if ((Boolean) filterRes){
                            return e;
                        }
                    }else {
                        // 操作符左边不是函数、属性默认就是xpath表达式了
                        List<Element> eltmp = new LinkedList<Element>();
                        eltmp.add(e);
                        List<Object> rstmp=evaluate(p.getLeft(),new Elements(eltmp));
                        if ((Boolean) p.getOpEm().excute(StringUtils.join(rstmp,""),p.getRight())){
                            return e;
                        }
                    }
                }
            }else {
View Full Code Here

Examples of com.alibaba.cobar.client.support.utils.Predicate

                        };
                    }
                    List<Object> resultList = executeInConcurrency(callback, dsMap);
                    @SuppressWarnings("unchecked")
                    Collection<Object> filteredResultList = CollectionUtils.select(resultList,
                            new Predicate() {
                                public boolean evaluate(Object item) {
                                    return item != null;
                                }
                            });
                    if (filteredResultList.size() > 1) {
View Full Code Here

Examples of com.alibaba.toolkit.util.collection.Predicate

     * @param context  ƥ��������
     *
     * @return ���ƥ��ɹ�, �򷵻�<code>true</code>
     */
    public boolean matches(MatchContext context) {
        Predicate predicate = context.getPredicate();

        // ���û��predicate, ��ѡ��ʹ�ø���Ч�IJ���
        if (predicate == null) {
            return matchWithoutPredicate(context);
        }

        Collection patterns      = context.getPatterns();
        List       matchItemList = new ArrayList(patterns.size());

        for (Iterator i = patterns.iterator(); i.hasNext();) {
            MatchPattern pattern = (MatchPattern) i.next();

            if (pattern.matches(context)) {
                matchItemList.add(context.getLastMatchItem());
            }
        }

        // ��ƥ��, ��ֱ�ӷ���null
        if (matchItemList.size() == 0) {
            return false;
        }


        // ��ƥ�䳤���ɴ�С����(�ȶ�)
        Collections.sort(matchItemList, MATCH_LENGTH_COMPARATOR);

        // ͨ��ָ����predicate��������ƥ����
        for (Iterator i = matchItemList.iterator(); i.hasNext();) {
            MatchItem item = (MatchItem) i.next();

            if (predicate.evaluate(item)) {
                context.setLastMatchItem(item);
                return true;
            }
        }

View Full Code Here

Examples of com.cloud.utils.Predicate

    public class VmJobVMSnapshotOutcome extends OutcomeImpl<VMSnapshot> {
        private long _vmSnapshotId;

        public VmJobVMSnapshotOutcome(final AsyncJob job, final long vmSnapshotId) {
            super(VMSnapshot.class, job, VmJobCheckInterval.value(), new Predicate() {
                @Override
                public boolean checkCondition() {
                    AsyncJobVO jobVo = _entityMgr.findById(AsyncJobVO.class, job.getId());
                    assert (jobVo != null);
                    if (jobVo == null || jobVo.getStatus() != JobInfo.Status.IN_PROGRESS)
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201306.cm.Predicate

        "ParentLocations", "Reach", "TargetingStatus"});

    selector.setPredicates(new Predicate[] {
        // Location names must match exactly, only EQUALS and IN are
        // supported.
        new Predicate("LocationName", PredicateOperator.IN, locationNames),
        // Set the locale of the returned location names.
        new Predicate("Locale", PredicateOperator.EQUALS, new String[] {"en"})});

    // Make the get request.
    LocationCriterion[] locationCriteria = locationCriterionService.get(selector);

    // Display the resulting location criteria.
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.Predicate

    Selector selector = new Selector();
    // Do not include "Attributes" because you do not want to pass existing
    // attributes into the subsequent mutate (SET) call.
    selector.setFields(new String[] {"Id", "Attributes"});
    selector.setPredicates(new Predicate[] {
        new Predicate("Id", PredicateOperator.EQUALS, new String[] {feedId.toString()})});
    Feed feed = feedService.get(selector).getEntries()[0];

    // Add new attributes to the feed.
    FeedAttribute[] newAttributes = addLine1And2FeedAttributes(adWordsServices, session, feed);
    FeedAttribute line1Attribute = newAttributes[0];
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201402.cm.Predicate

        }
      }
    }

    // Create predicate and selector.
    Predicate predicate = new Predicate();
    predicate.setField("Id");
    predicate.setOperator(PredicateOperator.IN);
    predicate.setValues(conversionIds.toArray(new String[0]));
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id"});
    selector.setPredicates(new Predicate[] {predicate});

    // Get all conversion trackers.
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.