Examples of compare()


Examples of org.apache.lucene.search.FieldComparator.compare()

    // Update existing group:
    for (int compIDX = 0;; compIDX++) {
      final FieldComparator fc = comparators[compIDX];
      fc.copy(spareSlot, doc);

      final int c = reversed[compIDX] * fc.compare(group.comparatorSlot, spareSlot);
      if (c < 0) {
        // Definitely not competitive.
        return;
      } else if (c > 0) {
        // Definitely competitive; set remaining comparators:
View Full Code Here

Examples of org.apache.nutch.crawl.UrlWithScore.UrlScoreComparator.compare()

    UrlWithScore k3 = new UrlWithScore("http://example.org/2", 1f);
    UrlWithScore k4 = new UrlWithScore("http://example.org/2", 2f);
    UrlWithScore k5 = new UrlWithScore("http://example.org/2", 3f);
   
    // k1 is after k2, because score is lower
    assertEquals(1, comp.compare(k1, k2));
    // test symmetry
    assertEquals(-1, comp.compare(k2, k1));
   
    // k1 is before k3, k4 and k5, because url is lower
    assertEquals(-1, compareBothRegularAndRaw(comp, k1, k3));
View Full Code Here

Examples of org.apache.sis.test.XMLComparator.compare()

        ensureFail("Should fail because the \"cellpading\" attribute value is different.", cmp);

        // Following comparison should not fail anymore.
        cmp.ignoredAttributes.add("cellpading");
        cmp.compare();

        cmp.ignoredAttributes.clear();
        cmp.ignoredAttributes.add("bgcolor");
        ensureFail("The \"cellpading\" attribute should not be ignored anymore.", cmp);
View Full Code Here

Examples of org.apache.solr.request.compare.MergerDetailSelectDetailRowCompare.compare()

      for(SelectDetailRow f:countsDetail)
      {
        SelectDetailRow mrow=f;
        if (res.size() < saverecords) {
          res.add(mrow);
        } else if (cmp.compare(res.peek(), mrow) > 0) {
          res.add(mrow);
          res.poll();
        }
      }
     
View Full Code Here

Examples of org.apache.solr.request.compare.MergerGroupByGroupbyRowCompare.compare()

      for(GroupbyRow f:collections)
      {
        GroupbyRow mrow=f;
        if (res.size() < saverecords) {
          res.add(mrow);
        } else if (cmp.compare(res.peek(), mrow) > 0) {
          res.add(mrow);
          res.poll();
        }
      }
     
View Full Code Here

Examples of org.apache.tajo.storage.TupleComparator.compare()

    if (idxReader.getFirstKey() == null && idxReader.getLastKey() == null) { // if # of rows is zero
      LOG.info("There is no contents");
      return null;
    }

    if (comparator.compare(end, idxReader.getFirstKey()) < 0 ||
        comparator.compare(idxReader.getLastKey(), start) < 0) {
      LOG.info("Out of Scope (indexed data [" + idxReader.getFirstKey() + ", " + idxReader.getLastKey() +
          "], but request start:" + start + ", end: " + end);
      return null;
    }
View Full Code Here

Examples of org.apache.uima.cas.FSIndex.compare()

      a = (AnnotationFS) it.get();
      // System.out.println(a);
      assertTrue(a != null);
      if (b != null) {
  // System.out.println("b = " + b);
  assertTrue(sortedIndex.compare(b, a) <= 0);
      }
      b = a;
      v.add(a.hashCode());
      it.moveToNext();
    }
View Full Code Here

Examples of org.apache.ws.commons.om.impl.llom.util.XMLComparator.compare()

        StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder("eprTest.xml");

        XMLComparator xmlComparator = new XMLComparator();

        assertTrue(
                xmlComparator.compare(omBuilder.getDocumentElement(),
                        defaultEnvelope));

    }

    public void testHeaderCreationFromMsgCtxtInformation() throws Exception {
View Full Code Here

Examples of org.apache.xerces.impl.dv.xs.TypeValidator.compare()

        //if the type is ordered then the corresponding TypeValidator should
        //know how to compare the values
        switch (comparator) {

        case CompNode.EQ: return typeValidator.compare(value1, value2) == 0;
        case CompNode.NE: return typeValidator.compare(value1, value2) != 0;
        case CompNode.GT: return typeValidator.compare(value1, value2) > 0;
        case CompNode.GE: return typeValidator.compare(value1, value2) >= 0;
        case CompNode.LT: return typeValidator.compare(value1, value2) < 0;
        case CompNode.LE: return typeValidator.compare(value1, value2) <= 0;
View Full Code Here

Examples of org.apache.xerces.validators.datatype.DatatypeValidator.compare()

                                    String  value       = unTrimValue.trim();
                                    DatatypeValidator tempDV = fTempAttDecl.datatypeValidator;
                                    // if "fixed" is specified, then get the fixed string,
                                    // and compare over value space
                                    if ((fTempAttDecl.defaultType & XMLAttributeDecl.DEFAULT_TYPE_FIXED) > 0 &&
                                        tempDV.compare(value, fTempAttDecl.defaultValue) != 0) {
                                        Object[] args = { fStringPool.toString(element.rawname),
                                                          fStringPool.toString(attrList.getAttrName(index)),
                                                          unTrimValue,
                                                          fTempAttDecl.defaultValue};
                                        fErrorReporter.reportError( fErrorReporter.getLocator(),
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.