Examples of Ordering


Examples of com.ebay.erl.mobius.core.sort.Sorter.Ordering

          this.setType(Tuple.getType(v1), Tuple.getType(v2));
          result = this.compare(v1, v2, conf);       
          if( result!=0 )
          {
            // ordering is decided, return the result
            Ordering ordering   = aSorter.getOrdering();
            switch(ordering)
            {
              case ASC:
                // remain the save
                return result;
View Full Code Here

Examples of com.foundationdb.qp.operator.API.Ordering

                    ExpressionGenerators.field(cType, 1, 1), // w
                    ExpressionGenerators.field(cType, 0, 0), // cid
                    ExpressionGenerators.field(oType, 0, 2), // oid
                    ExpressionGenerators.field(iType, 0, 5// iid
                );
                Ordering ordering = API.ordering();
                for(int i = 0; i < expList.size(); ++i) {
                    TPreparedExpression prep = expList.get(i).getTPreparedExpression();
                    ordering.append(ExpressionGenerators.field(prep.resultType(), i), true);
                }
                Operator plan = API.groupScan_Default(cType.table().getGroup());
                plan = API.filter_Default(plan, Arrays.asList(cType, oType, iType));
                plan = API.flatten_HKeyOrdered(plan, cType, oType, JoinType.LEFT_JOIN);
                plan = API.flatten_HKeyOrdered(plan, plan.rowType(), iType, JoinType.LEFT_JOIN);
View Full Code Here

Examples of com.google.common.collect.Ordering

            subjectVocabularyScore.put(tempToken , simScore);
        }*/
      }
     
      // Sort documents by relevance
      Ordering valueComparator = Ordering.natural().onResultOf(Functions.forMap(scoreMap)).compound(Ordering.natural());
      sortedRankList = ImmutableSortedMap.copyOf(scoreMap, valueComparator);
   
    }
    catch (Exception e)
    {
View Full Code Here

Examples of eu.stratosphere.api.common.operators.Ordering

  @Override
  public void computeInterestingPropertiesForInputs(CostEstimator estimator) {
    final InterestingProperties iProps = new InterestingProperties();
   
    {
      final Ordering partitioning = getPactContract().getPartitionOrdering();
      final DataDistribution dataDist = getPactContract().getDataDistribution();
      final RequestedGlobalProperties partitioningProps = new RequestedGlobalProperties();
      if (partitioning != null) {
        if(dataDist != null) {
          partitioningProps.setRangePartitioned(partitioning, dataDist);
        } else {
          partitioningProps.setRangePartitioned(partitioning);
        }
        iProps.addGlobalProperties(partitioningProps);
      }
      iProps.addGlobalProperties(partitioningProps);
    }
   
    {
      final Ordering localOrder = getPactContract().getLocalOrder();
      final RequestedLocalProperties orderProps = new RequestedLocalProperties();
      if (localOrder != null) {
        orderProps.setOrdering(localOrder);
      }
      iProps.addLocalProperties(orderProps);
View Full Code Here

Examples of fj.Ordering

   * @param step The increment to step.
   * @return A stream using the given enumerator from the given value to the other given value stepping at the given
   *         increment.
   */
  public static <A> Stream<A> range(final Enumerator<A> e, final A from, final A to, final long step) {
    final Ordering o = e.order().compare(from, to);
    return o == EQ || step > 0L && o == GT || step < 0L && o == LT ? single(from) : cons(from, new P1<Stream<A>>() {
      public Stream<A> _1() {
        return Stream.join(e.plus(from, step).filter(new F<A, Boolean>() {
          public Boolean f(final A a) {
            return !(o == LT ? e.order().isLessThan(to, a) : e.order().isGreaterThan(to, a));
View Full Code Here

Examples of javax.jcr.query.qom.Ordering

    /**
     * Test case for {@link QueryObjectModelFactory#ascending(DynamicOperand)}
     */
    public void testOrderingAscending() throws RepositoryException {
        PropertyValue op = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering asc = qf.ascending(op);
        assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_ASCENDING",
                QueryObjectModelConstants.JCR_ORDER_ASCENDING, asc.getOrder());
        assertTrue("Not a PropertyValue operand", asc.getOperand() instanceof PropertyValue);
    }
View Full Code Here

Examples of javax.jcr.query.qom.Ordering

    public void testCreateQueryWithConstraintAndOrdering() throws RepositoryException {
        Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
View Full Code Here

Examples of javax.jcr.query.qom.Ordering

    public void testCreateQueryWithConstraintOrderingAndColumn() throws RepositoryException {
        Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
View Full Code Here

Examples of javax.jcr.query.qom.Ordering

    public void testCreateQueryFromSourceWithConstraintAndOrdering() throws RepositoryException {
        Source selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
View Full Code Here

Examples of javax.jcr.query.qom.Ordering

    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
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.