public abstract class AbstractPivotChooser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static StatisticRefCounter |
counterBucketReadBuckets
Global bucket accesses refcounter statistic
|
protected static StatisticCounter |
counterObjectDistComp
Global distance computations statistic counter
|
protected static StatisticCounter |
counterPivotDistComp
Statistic counter for pivot chooser distance computations
|
protected static StatisticRefCounter |
counterPivotReadBuckets
Statistic refcounter for pivot chooser accesses to bucket
|
protected java.util.List<LocalAbstractObject> |
preselectedPivots
List of selected pivots
|
protected java.util.Set<ObjectProvider<? extends LocalAbstractObject>> |
sampleProviders
Registered sample providers
|
Constructor and Description |
---|
AbstractPivotChooser() |
Modifier and Type | Method and Description |
---|---|
void |
addPivot(LocalAbstractObject pivot)
This method appends a new pivot to the currently existing list.
|
void |
clear()
Clears the list of preselected pivots.
|
void |
deregisterSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
Removes registration of a sample set provider that was previously registered
(others are silently ignored).
|
LocalAbstractObject |
getLastPivot()
Access to the last selected pivot.
|
LocalAbstractObject |
getNextPivot()
Returns a new pivot that is freshly selected.
|
LocalAbstractObject |
getPivot()
Access to the first selected pivot (even if more pivots are available).
|
LocalAbstractObject |
getPivot(int position)
Returns a reference to a preselected pivot at the desired position.
|
java.util.Iterator<LocalAbstractObject> |
iterator()
Provides a read-only iterator over the collection of currently selected pivots
|
void |
registerSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
Registers a new sample set provider used by this pivot chooser to select pivots.
|
LocalAbstractObject |
removeLastPivot()
Deletes the last pivot from the list of current pivots and returns it.
|
void |
selectPivot()
Selects one pivot and appends it to the list of pivots.
|
void |
selectPivot(int count)
Method for selecting pivots and appending them to the list of pivots.
|
protected abstract void |
selectPivot(int count,
AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
This method carries out the actual pivot selection and must be implemented by
subclasses.
|
int |
size()
The number of currently selected pivots.
|
protected final java.util.List<LocalAbstractObject> preselectedPivots
protected final java.util.Set<ObjectProvider<? extends LocalAbstractObject>> sampleProviders
protected static final StatisticCounter counterPivotDistComp
protected static final StatisticCounter counterObjectDistComp
protected static final StatisticRefCounter counterPivotReadBuckets
protected static final StatisticRefCounter counterBucketReadBuckets
public void clear()
public int size()
public java.util.Iterator<LocalAbstractObject> iterator()
public LocalAbstractObject getPivot()
public LocalAbstractObject getLastPivot()
public LocalAbstractObject getNextPivot()
public LocalAbstractObject getPivot(int position) throws java.lang.IndexOutOfBoundsException
position
- The possition (number) of the requested pivotjava.lang.IndexOutOfBoundsException
- Thrown if the pivot selection cannot select enough additional pivotspublic LocalAbstractObject removeLastPivot()
public void addPivot(LocalAbstractObject pivot)
pivot
- The pivot added to the preselected listpublic final void selectPivot()
public final void selectPivot(int count)
count
- Number of pivots to generateprotected abstract void selectPivot(int count, AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
addPivot
method.count
- Number of pivots to generatesampleSetIterator
- Iterator over the sample set of objects to choose new pivots frompublic void registerSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
provider
- the sample set providerpublic void deregisterSampleProvider(ObjectProvider<? extends LocalAbstractObject> provider)
provider
- the previously registered sample set provider