Examples of skipTo()


Examples of dovetaildb.querynode.QueryNode.skipTo()

    s = index.getTerm(t1, revNum);
    assertTrue(s.next());
    doc0 = s.doc();
    assertFalse(s.next());
   
    assertTrue(allTerms.skipTo(doc0));
    assertEquals(0, allTerms.term().compareTo(t1));
    assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
    assertEquals(0, allTerms.term().compareTo(t2));
    assertEquals(NextStatus.NEXT_TERM, allTerms.nextTerm());
    assertEquals(0, allTerms.term().compareTo(t4));
View Full Code Here

Examples of edu.cornell.med.icb.goby.alignments.AlignmentReader.skipTo()

    // Test below is disabled, it depends on a resource we don't control
    @Ignore
    public void testOldGobyHybridUrl() throws IOException {
        AlignmentReader reader = new AlignmentReaderImpl("http://gobyweb.apps.campagnelab.org/data/H_T_D/MYHZZJH/MYHZZJH-hybrid-domain.header");
        reader.reposition(10, 1210);
        final Alignments.AlignmentEntry entry = reader.skipTo(10, 1210);
        org.junit.Assert.assertNotNull(entry);
    }

    private String basesToText(byte[] bases) {
        StringBuffer sb = new StringBuffer();
View Full Code Here

Examples of edu.cornell.med.icb.goby.alignments.AlignmentReaderImpl.skipTo()

    // Test below is disabled, it depends on a resource we don't control
    @Ignore
    public void testOldGobyHybridUrl() throws IOException {
        AlignmentReader reader = new AlignmentReaderImpl("http://gobyweb.apps.campagnelab.org/data/H_T_D/MYHZZJH/MYHZZJH-hybrid-domain.header");
        reader.reposition(10, 1210);
        final Alignments.AlignmentEntry entry = reader.skipTo(10, 1210);
        org.junit.Assert.assertNotNull(entry);
    }

    private String basesToText(byte[] bases) {
        StringBuffer sb = new StringBuffer();
View Full Code Here

Examples of edu.cornell.med.icb.goby.counts.CountBinningAdapterI.skipTo()

            if (counts.hasIndex()) {
                // we can only reposition if the countsreader has an index. Otherwise, we trust the
               // caching counts  archive  to have created a new reader positioned at the start of the counts sequence.
                binAdaptor.reposition(startLocation);
            }
            binAdaptor.skipTo(startLocation);

            int position = binAdaptor.getPosition();
            ObjectArrayList<LocusScore> result = new ObjectArrayList<LocusScore>();
            result.add(new BasicScore(initialStartPosition, position, 0.0f));
            while (binAdaptor.hasNextTransition() && position < endLocation) {
View Full Code Here

Examples of edu.cornell.med.icb.goby.counts.CountBinningAdaptor.skipTo()

            if (counts.hasIndex()) {
                // we can only reposition if the countsreader has an index. Otherwise, we trust the
               // caching counts  archive  to have created a new reader positioned at the start of the counts sequence.
                binAdaptor.reposition(startLocation);
            }
            binAdaptor.skipTo(startLocation);

            int position = binAdaptor.getPosition();
            ObjectArrayList<LocusScore> result = new ObjectArrayList<LocusScore>();
            result.add(new BasicScore(initialStartPosition, position, 0.0f));
            while (binAdaptor.hasNextTransition() && position < endLocation) {
View Full Code Here

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

           
            for( start = 0; start < l.size(); start++ ) {
              for( end = start + 1; end < l.size(); end++ ) {
                IndexIterator indexIterator = termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
               
                result = indexIterator.skipTo( l.getInt( start ) );
                if ( indexIterator.document() != l.getInt( start ) || result != l.getInt( start ) ) throw new AssertionError( "Trying to skip to document " + l.getInt( start ) + " (term " + t + ") moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
                result = indexIterator.skipTo( l.getInt( end ) );
                if ( indexIterator.document() != l.getInt( end ) || result != l.getInt( end ) ) throw new AssertionError( "Trying to skip to document " + l.getInt( end ) + " (term " + t + ") after a skip to " + start + " moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
               
                if ( index[ i ].hasPositions ) {
View Full Code Here

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

              for( end = start + 1; end < l.size(); end++ ) {
                IndexIterator indexIterator = termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
               
                result = indexIterator.skipTo( l.getInt( start ) );
                if ( indexIterator.document() != l.getInt( start ) || result != l.getInt( start ) ) throw new AssertionError( "Trying to skip to document " + l.getInt( start ) + " (term " + t + ") moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
                result = indexIterator.skipTo( l.getInt( end ) );
                if ( indexIterator.document() != l.getInt( end ) || result != l.getInt( end ) ) throw new AssertionError( "Trying to skip to document " + l.getInt( end ) + " (term " + t + ") after a skip to " + start + " moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
               
                if ( index[ i ].hasPositions ) {
                  // This catches wrong state reconstruction after skips.
                  indexIterator = termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
View Full Code Here

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

                if ( indexIterator.document() != l.getInt( end ) || result != l.getInt( end ) ) throw new AssertionError( "Trying to skip to document " + l.getInt( end ) + " (term " + t + ") after a skip to " + start + " moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
               
                if ( index[ i ].hasPositions ) {
                  // This catches wrong state reconstruction after skips.
                  indexIterator = termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
                  indexIterator.skipTo( l.getInt( start ) );
                  if ( indexIterator.document() != l.getInt( start ) ) throw new AssertionError(indexIterator.document() + " != " + l.getInt( start ) );
                  if ( indexIterator.count() != positions.get( start ).length ) throw new AssertionError(indexIterator.count() + " != " + positions.get( start ).length );
                  if ( ! Arrays.equals( positions.get( start ), ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) )
                     ) throw new AssertionError(Arrays.toString( positions.get( start ) ) + "!=" + Arrays.toString( ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) ) );
                  indexIterator.skipTo( l.getInt( end ) );
View Full Code Here

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

                  indexIterator.skipTo( l.getInt( start ) );
                  if ( indexIterator.document() != l.getInt( start ) ) throw new AssertionError(indexIterator.document() + " != " + l.getInt( start ) );
                  if ( indexIterator.count() != positions.get( start ).length ) throw new AssertionError(indexIterator.count() + " != " + positions.get( start ).length );
                  if ( ! Arrays.equals( positions.get( start ), ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) )
                     ) throw new AssertionError(Arrays.toString( positions.get( start ) ) + "!=" + Arrays.toString( ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) ) );
                  indexIterator.skipTo( l.getInt( end ) );
                  if ( indexIterator.document() != l.getInt( end )  ) throw new AssertionError(indexIterator.document() + " != " + l.getInt( end ) );
                  if ( indexIterator.count() != positions.get( end ).length ) throw new AssertionError(indexIterator.count() + " != " + positions.get( end ).length );
                  if ( ! Arrays.equals( positions.get( end ), ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) )
                     ) throw new AssertionError(Arrays.toString( positions.get( end ) ) + "!=" + Arrays.toString( ArrayUtils.subarray( indexIterator.positionArray(), 0, indexIterator.count() ) ) );
                }
View Full Code Here

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

               
              }
             
              IndexIterator indexIterator = termLists ? indexReader[ i ].documents( terms[ i ].get( t ) ) : indexReader[ i ].documents( t );
             
              result = indexIterator.skipTo( l.getInt( start ) );
              if ( indexIterator.document() != l.getInt( start ) || result != l.getInt( start ) ) throw new AssertionError("Trying to skip to document " + l.getInt( start ) + " (term " + t + ") moved to " + indexIterator.document() + "(skipTo() returned " + result + ")" );
              result = indexIterator.skipTo( Integer.MAX_VALUE );
              if ( indexIterator.hasNext() || result != Integer.MAX_VALUE ) throw new AssertionError("Trying to skip beyond end of list (term " + t + ") after a skip to " + start + " returned " + result + " (hasNext()=" + indexIterator.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.