messif.pivotselection
Class StreamSequencePivotChooser

java.lang.Object
  extended by messif.pivotselection.AbstractPivotChooser
      extended by messif.pivotselection.StreamSequencePivotChooser
All Implemented Interfaces:
java.io.Serializable

public class StreamSequencePivotChooser
extends AbstractPivotChooser
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  AbstractStreamObjectIterator<LocalAbstractObject> stream
          Stream to read pivots from
 
Fields inherited from class messif.pivotselection.AbstractPivotChooser
counterBucketReadBuckets, counterObjectDistComp, counterPivotDistComp, counterPivotReadBuckets, preselectedPivots, sampleProviders
 
Constructor Summary
StreamSequencePivotChooser(java.lang.Class<? extends LocalAbstractObject> objClass, java.lang.String fileName)
          Creates a new instance of StreamSequencePivotChooser.
 
Method Summary
protected  void selectPivot(int count, AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
          This method carries out the actual pivot selection, that is, read specified number of objects from the stream.
 
Methods inherited from class messif.pivotselection.AbstractPivotChooser
addPivot, clear, deregisterSampleProvider, getLastPivot, getNextPivot, getPivot, getPivot, iterator, registerSampleProvider, removeLastPivot, selectPivot, selectPivot, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected final AbstractStreamObjectIterator<LocalAbstractObject> stream
Stream to read pivots from

Constructor Detail

StreamSequencePivotChooser

public StreamSequencePivotChooser(java.lang.Class<? extends LocalAbstractObject> objClass,
                                  java.lang.String fileName)
                           throws java.lang.IllegalArgumentException,
                                  java.io.IOException
Creates a new instance of StreamSequencePivotChooser.

Parameters:
objClass - the class of objects to read from the stream
fileName - the file to read objects from
Throws:
java.lang.IllegalArgumentException - if the provided class does not have a proper "stream" constructor
java.io.IOException - if there was an error opening the file
Method Detail

selectPivot

protected void selectPivot(int count,
                           AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
This method carries out the actual pivot selection, that is, read specified number of objects from the stream.

Specified by:
selectPivot in class AbstractPivotChooser
Parameters:
count - number of pivots to generate
sampleSetIterator - ignored by this chooser, since the pivots are provided externally