Examples of positions()


Examples of com.google.apphosting.api.DatastorePb.CompiledCursor.positions()

   * @return a new cursor to the location in a query sorted in the reverse direction
   * @see com.google.appengine.api.datastore.Query#reverse()
   */
  public Cursor reverse() {
    CompiledCursor clone = compiledCursor.clone();
    for (Position pos : clone.positions()) {
      pos.setStartInclusive(!pos.isStartInclusive());
    }
    return new Cursor(clone);
  }

View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

         
         
          int[] firstPos = new int[1000];
          int[] secondPos = new int[1000];
          int fRet = firstIterator.positions(firstPos);
          int sRet = secondIterator.positions(secondPos);
          System.out.println(fRet + "  " + sRet);
          Assert.assertTrue(fRet == sRet);
         
          for(int j = 0;j<fRet;j++)
            Assert.assertEquals(firstPos[j],secondPos[j]);       
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

        while(firstIterator.hasNext()){
          firstIterator.next();
          secondIterator.next();
 
          IntIterator firstIntIt = firstIterator.positions();
          IntIterator secondIntIt = secondIterator.positions();       
          while(firstIntIt.hasNext()){                 
            Assert.assertEquals(firstIntIt.nextInt(),secondIntIt.nextInt());
          }       
          Assert.assertEquals(firstIntIt.skip(2),secondIntIt.skip(2));       
          if(firstIntIt.hasNext()){
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

                      int c = indexIterator.count();
                      if ( termsInDoc[ i ].get( t ) !=  c )
                        LOGGER.error( index[ i ] + ": The count for term " + t + " in document " + currDoc + " is " + c + " instead of " + termsInDoc[ i ].get( t ) );
                      else {
                        if ( index[ i ].hasPositions ) {
                          indexIterator.positions( occ[ i ] );

                          for( int j = 0; j < c; j++ )
                            if ( wordInPos[ i ][ occ[ i ][ j ] ] != t
                              LOGGER.error( index[ i ] + ": The occurrence of index " + i + " of term " + t + " (position " + occ[ i ] +") in document " + currDoc + " is occupied instead by term " + wordInPos[ i ][ occ[ i ][ j ] ] );
                        }
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

                      int c = indexIterator.count();
                      if ( termsInDoc[ i ].get( t ) !=  c )
                        LOGGER.error( index[ i ] + ": The count for term " + t + " in document " + currDoc + " is " + c + " instead of " + termsInDoc[ i ].get( t ) );
                      else {
                        if ( index[ i ].hasPositions ) {
                          indexIterator.positions( occ[ i ] );

                          for( int j = 0; j < c; j++ )
                            if ( wordInPos[ i ][ occ[ i ][ j ] ] != t
                              LOGGER.error( index[ i ] + ": The occurrence of index " + i + " of term " + t + " (position " + occ[ i ] +") in document " + currDoc + " is occupied instead by term " + wordInPos[ i ][ occ[ i ][ j ] ] );
                        }
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

                if ( word.length() == 0 || index[ i ].termProcessor != null && ! index[ i ].termProcessor.processTerm( word ) ) continue;
                IndexIterator indexIterator = indexReader[ i ].documents( word );
                if ( currDoc != indexIterator.skipTo( currDoc ) )
                  LOGGER.error( index[ i ] + ": Document " + currDoc + " does not appear in the inverted list of term " + word );
                else if ( index[ i ].hasPositions ) {
                  indexIterator.positions( occ[ i ] );
                  if ( IntArrayList.wrap( occ[ i ], indexIterator.count() ).indexOf( pos ) == -1 )
                    LOGGER.error( index[ i ] + ": Position " + pos + " does not appear in the position list of term " + word + " in document " + currDoc );
                }
                pos++;
              }
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.positions()

    new IndexBuilder( basename, new StringArrayDocumentCollection( "a a" ) ).keepBatches( true ).run();
    IndexIterator indexIterator = Index.getInstance( basename + "-text@0" ).documents( 0 );
    indexIterator.next();
    assertEquals( 2, indexIterator.count() );
    int[] position = new int[ 2 ];
    indexIterator.positions( position );
    assertEquals( 0, position[ 0 ] );
    assertEquals( 1, position[ 1 ] );
  }

View Full Code Here

Examples of it.unimi.dsi.mg4j.index.MultiTermIndexIterator.positions()

    assertEquals( 3, position[ 3 ] );

    assertEquals( Interval.valueOf( 2 ), multiTermIndexIterator.intervalIterator().nextInterval() );
   
    position = new int[ 4 ];
    multiTermIndexIterator.positions( position );
    assertEquals( 0, position[ 0 ] );
    assertEquals( 1, position[ 1 ] );
    assertEquals( 2, position[ 2 ] );
    assertEquals( 3, position[ 3 ] );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.MultiTermIndexIterator.positions()

    assertEquals( 3, position[ 3 ] );

   
    assertEquals( Interval.valueOf( 3 ), multiTermIndexIterator.intervalIterator().nextInterval() );

    IntIterator positions = multiTermIndexIterator.positions();
    assertEquals( 0, positions.nextInt() );
    assertEquals( 1, positions.nextInt() );
    assertEquals( 2, positions.nextInt() );
    assertEquals( 3, positions.nextInt() );
    assertFalse( positions.hasNext() );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.MultiTermIndexIterator.positions()

    assertEquals( 2, multiTermIndexIterator.count() );
    position = multiTermIndexIterator.positionArray();
    assertEquals( 0, position[ 0 ] );
    assertEquals( 2, position[ 1 ] );
    positions = multiTermIndexIterator.positions();
    assertEquals( 0, positions.nextInt() );
    assertEquals( 2, positions.nextInt() );
    assertFalse( positions.hasNext() );
   
    assertFalse( multiTermIndexIterator.intervalIterator().hasNext() );
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.