Package it.unimi.dsi.mg4j.search

Examples of it.unimi.dsi.mg4j.search.OrDocumentIterator$OrIndexIntervalIterator


        { {} },
        {},
        { {} },
        {},
        } );
    OrDocumentIterator orDocumentIterator = (OrDocumentIterator)OrDocumentIterator.getInstance( i0, i1 );
    assertTrue( orDocumentIterator.hasNext() );
    assertTrue( orDocumentIterator.hasNext() ); // To increase coverage
   
    assertEquals( 0, orDocumentIterator.nextDocument() );
    assertTrue( orDocumentIterator.intervalIterator().hasNext() );
    assertTrue( orDocumentIterator.intervalIterator().hasNext() ); // To increase coverage
    assertEquals( Interval.valueOf( 0, 1 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( orDocumentIterator.intervalIterator().hasNext() );
    assertFalse( orDocumentIterator.intervalIterator().hasNext() ); // To increase coverage
   
    assertEquals( 1, orDocumentIterator.nextDocument() );
    assertEquals( Interval.valueOf( 1, 1 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( orDocumentIterator.intervalIterator().hasNext() );

    assertEquals( 2, orDocumentIterator.nextDocument() );
    assertEquals( Interval.valueOf( 0, 1 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 1, 2 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 3, 4 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( orDocumentIterator.intervalIterator().hasNext() );

    assertEquals( 3, orDocumentIterator.nextDocument() );
    assertEquals( Interval.valueOf( 0, 1 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertEquals( Interval.valueOf( 1, 2 ), orDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( orDocumentIterator.intervalIterator().hasNext() );

    assertEquals( 4, orDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, orDocumentIterator.intervalIterator() );
   
    assertEquals( 5, orDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, orDocumentIterator.intervalIterator() );

    assertEquals( 6, orDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.TRUE, orDocumentIterator.intervalIterator() );
   
    assertEquals( 7, orDocumentIterator.nextDocument() );
    assertEquals( IntervalIterators.FALSE, orDocumentIterator.intervalIterator() );
  }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.mg4j.search.OrDocumentIterator$OrIndexIntervalIterator

Copyright © 2018 www.massapicom. 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.