@Override public IntervalIterator reset() throws IOException { queue.clear(); maxRight = Integer.MIN_VALUE; lastLeft = Integer.MIN_VALUE; endOfProcess = false; for ( int i = 0; i < n; i++ ) { // The case != index is identical to the TRUE/FALSE case in AndIntervalIterator. final Index indexIteratorIndex = indexIterator[ i ].index(); if ( indexIteratorIndex == index && indexIteratorIndex.hasPositions ) { curr[ i ] = indexIterator[ i ].nextPosition(); queue.enqueue( i ); maxRight = Math.max( maxRight, curr[ i ] ); } } if ( ASSERTS ) assert ! queue.isEmpty(); return this; }
@Override public IntervalIterator reset() throws IOException { queue.clear(); maxRight = Integer.MIN_VALUE; lastLeft = Integer.MIN_VALUE; endOfProcess = false; for ( int i = 0; i < n; i++ ) { // The case != index is identical to the TRUE/FALSE case in AndIntervalIterator. final Index indexIteratorIndex = indexIterator[ i ].index(); if ( indexIteratorIndex == index && indexIteratorIndex.hasPositions ) { curr[ i ] = indexIterator[ i ].nextPosition(); queue.enqueue( i ); maxRight = Math.max( maxRight, curr[ i ] ); } } if ( ASSERTS ) assert ! queue.isEmpty(); return this; }
public void reset() throws IOException { queue.clear(); maxRight = Integer.MIN_VALUE; lastLeft = Integer.MIN_VALUE; next = null; endOfProcess = false; for ( int i = 0; i < n; i++ ) { // The case != index is identical to the TRUE/FALSE case in AndIntervalIterator. final Index indexIteratorIndex = indexIterator[ i ].index(); if ( indexIteratorIndex == index && indexIteratorIndex.hasPositions ) { position[ i ] = indexIterator[ i ].positionArray(); count[ i ] = indexIterator[ i ].count(); curr[ i ] = position[ i ][ currPos[ i ] = 0 ]; queue.enqueue( i ); maxRight = Math.max( maxRight, curr[ i ] ); } } if ( ASSERTS ) assert ! queue.isEmpty(); }
public void reset() throws IOException { queue.clear(); maxRight = Integer.MIN_VALUE; lastLeft = Integer.MIN_VALUE; next = null; endOfProcess = false; for ( int i = 0; i < n; i++ ) { // The case != index is identical to the TRUE/FALSE case in AndIntervalIterator. final Index indexIteratorIndex = indexIterator[ i ].index(); if ( indexIteratorIndex == index && indexIteratorIndex.hasPositions ) { position[ i ] = indexIterator[ i ].positionArray(); count[ i ] = indexIterator[ i ].count(); curr[ i ] = position[ i ][ currPos[ i ] = 0 ]; queue.enqueue( i ); maxRight = Math.max( maxRight, curr[ i ] ); } } if ( ASSERTS ) assert ! queue.isEmpty(); }
public void reset() throws IOException { emitted = extracted = 0; next = null; positionQueue.clear(); for ( int i = computeFront(), k; i-- != 0; ) { k = front[ i ]; position[ k ] = indexIterator[ k ].positionArray(); count[ k ] = indexIterator[ k ].count(); curr[ k ] = position[ k ][ 0 ]; currPos[ k ] = 0; positionQueue.enqueue( k ); } if ( ASSERTS ) assert ! positionQueue.isEmpty(); }
public void reset() throws IOException { emitted = extracted = 0; next = null; positionQueue.clear(); for ( int i = computeFront(), k; i-- != 0; ) { k = front[ i ]; position[ k ] = indexIterator[ k ].positionArray(); count[ k ] = indexIterator[ k ].count(); curr[ k ] = position[ k ][ 0 ]; currPos[ k ] = 0; positionQueue.enqueue( k ); } if ( ASSERTS ) assert ! positionQueue.isEmpty(); }
public void reset() throws IOException { last = Integer.MIN_VALUE; positionQueue.clear(); for ( int i = computeFront(), k; i-- != 0; ) { k = front[ i ]; if ( indexIterator[ k ].index() == index && indexIterator[ k ].index().hasPositions ) { position[ k ] = indexIterator[ k ].positionArray(); count[ k ] = indexIterator[ k ].count(); curr[ k ] = position[ k ][ currPos[ k ] = 0 ]; positionQueue.enqueue( k ); } } if ( ASSERTS ) assert ! positionQueue.isEmpty(); next = Interval.valueOf( curr[ positionQueue.first() ] ); }
public void reset() throws IOException { positionQueue.clear(); for ( int i = computeFront(), k; i-- != 0; ) { k = front[ i ]; if ( indexIterator[ k ].index() == index && indexIterator[ k ].index().hasPositions ) { position[ k ] = indexIterator[ k ].positionArray(); count[ k ] = indexIterator[ k ].count(); curr[ k ] = position[ k ][ currPos[ k ] = 0 ]; positionQueue.enqueue( k ); } } if ( ASSERTS ) assert ! positionQueue.isEmpty(); next = Interval.valueOf( curr[ positionQueue.first() ] ); }
indices.addAll( documentIterator[ i ].indices() ); globalDocumentPointer[ i ] = strategy.globalPointer( usedIndex[ i ], result ); queue.enqueue( i );
indices.addAll( documentIterator[ i ].indices() ); globalDocumentPointer[ i ] = strategy.globalPointer( usedIndex[ i ], result ); queue.enqueue( i );
/** Creates a new document iterator that computes the OR of the given array of iterators. * @param documentIterator the iterators to be joined. * @throws IOException */ protected AbstractUnionDocumentIterator( final DocumentIterator... documentIterator ) throws IOException { super( documentIterator ); this.refArray = new int[ n ]; queue = new IntHeapSemiIndirectPriorityQueue( refArray ); intervalIterators = new Reference2ReferenceArrayMap<Index,IntervalIterator>( indices.size() ); currentIterators = new Reference2ReferenceArrayMap<Index,IntervalIterator>( indices.size() ); unmodifiableCurrentIterators = Reference2ReferenceMaps.unmodifiable( currentIterators ); // Only add to the queue nonempty iterators... for ( int i = 0; i < n; i++ ) if ( ( refArray[ i ] = documentIterator[ i ].nextDocument() ) != -1 ) queue.enqueue( i ); // If queue is empty, the process is over if ( queue.isEmpty() ) curr = END_OF_LIST; else { curr = refArray[ queue.first() ]; ahead = true; } front = new int[ queue.size() ]; }
if ( ! metadataOnly ) { doc[ currIndex ] = indexIterator[ currIndex ].nextDocument(); documentQueue.enqueue( currIndex );
if ( ! metadataOnly ) { doc[ currIndex ] = indexIterator[ currIndex ].nextDocument(); documentQueue.enqueue( currIndex );