org.gcube.search.datafusion.datatypes
Class RSFusedIterator

java.lang.Object
  extended by org.gcube.search.datafusion.datatypes.RSFusedIterator
All Implemented Interfaces:
Serializable, Iterator<PositionalRecordWrapper>

public class RSFusedIterator
extends Object
implements Iterator<PositionalRecordWrapper>, Serializable

Fuses multiple iterators into one. Since it operates over GenericRecords sorting is performed during the fusion based on their rank (if no rank is specified the record is consider as high-ranked)

Author:
Alex Antoniadis
See Also:
Serialized Form

Constructor Summary
RSFusedIterator(List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> streamIters)
           
RSFusedIterator(List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> streamIters, int n)
           
RSFusedIterator(URI[] locators)
           
RSFusedIterator(URI[] locators, int n)
           
 
Method Summary
 boolean hasNext()
           
static List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> locatorsToItersList(URI[] locators)
          Converts an array on locators into a list of iterators over those locators
static Iterator<gr.uoa.di.madgik.grs.record.GenericRecord> locatorToIterator(URI locator)
           
 PositionalRecordWrapper next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSFusedIterator

public RSFusedIterator(URI[] locators)
                throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException

RSFusedIterator

public RSFusedIterator(URI[] locators,
                       int n)
                throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException

RSFusedIterator

public RSFusedIterator(List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> streamIters)

RSFusedIterator

public RSFusedIterator(List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> streamIters,
                       int n)
Method Detail

locatorToIterator

public static Iterator<gr.uoa.di.madgik.grs.record.GenericRecord> locatorToIterator(URI locator)
                                                                             throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException

locatorsToItersList

public static List<Iterator<gr.uoa.di.madgik.grs.record.GenericRecord>> locatorsToItersList(URI[] locators)
                                                                                     throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
Converts an array on locators into a list of iterators over those locators

Parameters:
locators -
Returns:
list of iterators
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<PositionalRecordWrapper>

next

public PositionalRecordWrapper next()
Specified by:
next in interface Iterator<PositionalRecordWrapper>

remove

public void remove()
Specified by:
remove in interface Iterator<PositionalRecordWrapper>


Copyright © 2013. All Rights Reserved.